commit: 1b43292c1940bf4c6da94ada5405ba98d7671b41
parent e11265ba5e52324b47fba5a2b1dcea8df50969f2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 20 Sep 2024 02:42:23 +0200
cmd/id: unify error message formatting
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cmd/id.c b/cmd/id.c
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
groups = calloc(ngroups_max, sizeof(*groups));
if(groups == NULL)
{
- perror("id: calloc(groups)");
+ perror("id: error: calloc(groups)");
return 1;
}
@@ -221,7 +221,7 @@ main(int argc, char *argv[])
ngroups = getgroups(ngroups_max, groups);
if(ngroups < 0)
{
- perror("id: getgroups");
+ perror("id: error: getgroups");
goto failure;
}
}
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
// Can only get groups from configuration
if(getgrouplist(pw.pw_name, pw.pw_gid, groups, &ngroups_max) < 0)
{
- perror("id: getgrouplist");
+ perror("id: error: getgrouplist");
goto failure;
}
ngroups = ngroups_max;
@@ -270,7 +270,7 @@ main(int argc, char *argv[])
if(gr == NULL || gr->gr_name == NULL)
{
ret--;
- fprintf(stderr, "id: cannot find name for group ID %u\n", gid);
+ fprintf(stderr, "id: error: Cannot find name for group ID %u\n", gid);
printf("%u\n", gid);
}
else
@@ -297,7 +297,7 @@ main(int argc, char *argv[])
if(pw.pw_name == NULL)
{
ret--;
- fprintf(stderr, "id: cannot find name for user ID %u\n", uid);
+ fprintf(stderr, "id: error: Cannot find name for user ID %u\n", uid);
printf("%u\n", uid);
}
else