From 23ec5395cfc6749ca7e65a41099f023fc16f9752 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 8 Dec 2020 14:46:02 +0100 Subject: [PATCH] Fixup PROGNAME --- src/id.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/id.c b/src/id.c index e35d53d..d6f171d 100644 --- a/src/id.c +++ b/src/id.c @@ -23,6 +23,11 @@ #include #include +/* constants */ +#ifndef PROGNAME +# define PROGNAME "id" +#endif + /* id */ static int _id_error(char const * message, int ret); @@ -45,7 +50,7 @@ static int _id(char const * user, int flag, int flagn, int flagr) /* _id_error */ static int _id_error(char const * message, int ret) { - fputs("id: ", stderr); + fputs(PROGNAME ": ", stderr); perror(message); return ret; } @@ -261,7 +266,7 @@ static struct group * _print_gid(gid_t gid) /* usage */ static int _usage(void) { - fputs("Usage: id [-Ggu][-nr] [user]\n\ + fputs("Usage: " PROGNAME " [-Ggu][-nr] [user]\n\ -G Output all different group IDs\n\ -g Output only the effective group ID\n\ -u Output only the effective user ID\n\