--- src/usr.bin/mesg/mesg.c 2003/10/04 20:36:49 1.3 +++ src/usr.bin/mesg/mesg.c 2005/02/19 19:39:05 1.4 @@ -47,7 +47,6 @@ #include #include #include -#include #include static void usage(void); @@ -69,27 +68,27 @@ main(int argc, char **argv) argv += optind; if ((tty = ttyname(STDERR_FILENO)) == NULL) - err(1, "ttyname"); + err(2, "ttyname failed"); if (stat(tty, &sb) < 0) - err(1, "%s", tty); + err(2, "%s", tty); if (*argv == NULL) { if (sb.st_mode & S_IWGRP) { - (void)fprintf(stderr, "is y\n"); + fprintf(stderr, "is y\n"); exit(0); } - (void)fprintf(stderr, "is n\n"); + fprintf(stderr, "is n\n"); exit(1); } switch (*argv[0]) { case 'y': if (chmod(tty, sb.st_mode | S_IWGRP) < 0) - err(1, "%s", tty); + err(2, "%s", tty); exit(0); case 'n': if (chmod(tty, sb.st_mode & ~S_IWGRP) < 0) - err(1, "%s", tty); + err(2, "%s", tty); exit(1); } @@ -100,6 +99,6 @@ main(int argc, char **argv) static void usage(void) { - (void)fprintf(stderr, "usage: mesg [y | n]\n"); + fprintf(stderr, "usage: mesg [y | n]\n"); exit(2); }