=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/at/at.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- src/usr.bin/at/at.c 2015/11/04 20:28:17 1.68 +++ src/usr.bin/at/at.c 2015/11/06 23:47:42 1.69 @@ -1,4 +1,4 @@ -/* $OpenBSD: at.c,v 1.68 2015/11/04 20:28:17 millert Exp $ */ +/* $OpenBSD: at.c,v 1.69 2015/11/06 23:47:42 millert Exp $ */ /* * at.c : Put file into atrun queue @@ -31,8 +31,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define MAIN_PROGRAM - #include #include @@ -100,7 +98,7 @@ static __dead void panic(const char *a) { - (void)fprintf(stderr, "%s: %s\n", ProgramName, a); + (void)fprintf(stderr, "%s: %s\n", __progname, a); if (fcreated) unlink(atfile); @@ -113,7 +111,7 @@ static __dead void panic2(const char *a, const char *b) { - (void)fprintf(stderr, "%s: %s%s\n", ProgramName, a, b); + (void)fprintf(stderr, "%s: %s%s\n", __progname, a, b); if (fcreated) unlink(atfile); @@ -498,7 +496,7 @@ } else uids = NULL; - shortformat = strcmp(ProgramName, "at") == 0; + shortformat = strcmp(__progname, "at") == 0; if (chdir(AT_DIR) != 0) perr2("Cannot change to ", AT_DIR); @@ -660,7 +658,7 @@ if (user_uid != pw->pw_uid && user_uid != 0) { fprintf(stderr, "%s: Only the superuser" " may %s other users' jobs\n", - ProgramName, what == ATRM + __progname, what == ATRM ? "remove" : "view"); exit(EXIT_FAILURE); } @@ -745,7 +743,7 @@ if (jobs[i] != NULL) { if (!force) fprintf(stderr, "%s: %s: no such job\n", - ProgramName, jobs[i]); + __progname, jobs[i]); error++; } } @@ -908,23 +906,18 @@ if (argc < 1) usage(); - if ((ProgramName = strrchr(argv[0], '/')) != NULL) - ProgramName++; - else - ProgramName = argv[0]; - user_uid = getuid(); user_gid = getgid(); spool_gid = getegid(); /* find out what this program is supposed to do */ - if (strcmp(ProgramName, "atq") == 0) { + if (strcmp(__progname, "atq") == 0) { program = ATQ; options = "cnvq:"; - } else if (strcmp(ProgramName, "atrm") == 0) { + } else if (strcmp(__progname, "atrm") == 0) { program = ATRM; options = "afi"; - } else if (strcmp(ProgramName, "batch") == 0) { + } else if (strcmp(__progname, "batch") == 0) { program = BATCH; options = "f:q:mv"; }