ps: use PROGNAME

This commit is contained in:
Pierre Pronchery 2020-12-08 14:16:02 +01:00
parent e97a7dbce7
commit 21c0d11c14

View File

@ -25,6 +25,11 @@
#include <pwd.h> #include <pwd.h>
#include <limits.h> #include <limits.h>
/* constants */
#ifndef PROGNAME
# define PROGNAME "ps"
#endif
/* ps */ /* ps */
/* private */ /* private */
@ -102,7 +107,7 @@ static int _ps(Prefs * prefs)
/* ps_error */ /* ps_error */
static int _ps_error(char const * message, int ret) static int _ps_error(char const * message, int ret)
{ {
fputs("ps: ", stderr); fputs(PROGNAME ": ", stderr);
perror(message); perror(message);
return ret; return ret;
} }
@ -111,7 +116,7 @@ static int _ps_error(char const * message, int ret)
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: ps [-g group][-p pid][-u username]\n", stderr); fputs("Usage: " PROGNAME " [-g group][-p pid][-u username]\n", stderr);
return 1; return 1;
} }