summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-12-10 16:20:00 +0100
committerKarel Zak <kzak@redhat.com>2010-12-10 16:20:00 +0100
commitaa00c136a5aaf413c66561b9b6dc1690a7bcebc6 (patch)
treed002ec3349dee4c548aa77b3e54f22b5e94ccce0
parentd0acbd38e2dfef68e07d732ca41b89d4f2e800b4 (diff)
downloadutil-linux-old-aa00c136a5aaf413c66561b9b6dc1690a7bcebc6.tar.gz
wall: remove progname
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--login-utils/wall.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/login-utils/wall.c b/login-utils/wall.c
index 47f0546a..383873b5 100644
--- a/login-utils/wall.c
+++ b/login-utils/wall.c
@@ -48,6 +48,7 @@
#include <sys/uio.h>
#include <err.h>
+#include <errno.h>
#include <paths.h>
#include <ctype.h>
#include <pwd.h>
@@ -81,8 +82,6 @@ int nobanner;
int mbufsize;
char *mbuf;
-char *progname = "wall";
-
int
main(int argc, char **argv) {
extern int optind;
@@ -96,11 +95,6 @@ main(int argc, char **argv) {
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- progname = argv[0];
- p = strrchr(progname, '/');
- if (p)
- progname = p+1;
-
while ((ch = getopt(argc, argv, "n")) != -1)
switch (ch) {
case 'n':
@@ -111,7 +105,8 @@ main(int argc, char **argv) {
case '?':
default:
usage:
- (void)fprintf(stderr, _("usage: %s [file]\n"), progname);
+ fprintf(stderr, _("usage: %s [file]\n"),
+ program_invocation_short_name);
exit(EXIT_FAILURE);
}
argc -= optind;
@@ -143,7 +138,7 @@ usage:
xstrncpy(line, utmpptr->ut_line, sizeof(utmpptr->ut_line));
if ((p = ttymsg(&iov, 1, line, 60*5)) != NULL)
- (void)fprintf(stderr, "%s: %s\n", progname, p);
+ warnx("%s", p);
}
endutent();
exit(EXIT_SUCCESS);