diff options
author | jkoshy <jkoshy@FreeBSD.org> | 1998-07-14 09:19:47 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 1998-07-14 09:19:47 +0000 |
commit | bf57a7d1d1e1af008a5e97eb56445f452973c8ed (patch) | |
tree | 6650417a777c837d43d3514e1e57956e43e09a28 /sbin | |
parent | 7842d15da67480e9fd71e1d23e441ecdb599ad34 (diff) | |
download | FreeBSD-src-bf57a7d1d1e1af008a5e97eb56445f452973c8ed.zip FreeBSD-src-bf57a7d1d1e1af008a5e97eb56445f452973c8ed.tar.gz |
Make `dump' exit codes confirm to manual page.
PR: 5346
Style-check-by: bde
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dump/dump.h | 1 | ||||
-rw-r--r-- | sbin/dump/dumprmt.c | 8 | ||||
-rw-r--r-- | sbin/dump/main.c | 24 |
3 files changed, 17 insertions, 16 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h index 6053198..2c907a9 100644 --- a/sbin/dump/dump.h +++ b/sbin/dump/dump.h @@ -144,6 +144,7 @@ void interrupt __P((int signo)); /* in case operator bangs on console */ * Exit status codes */ #define X_FINOK 0 /* normal exit */ +#define X_STARTUP 1 /* startup error */ #define X_REWRITE 2 /* restart writing from the check point */ #define X_ABORT 3 /* abort dump; don't attempt checkpointing */ diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index 84fef13..f27d214 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)dumprmt.c 8.3 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: dumprmt.c,v 1.11 1998/06/15 06:58:09 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -154,19 +154,19 @@ rmtgetconn() if (sp == NULL) { msg("%s/tcp: unknown service\n", dokerberos ? "kshell" : "shell"); - exit(X_ABORT); + exit(X_STARTUP); } pwd = getpwuid(getuid()); if (pwd == NULL) { msg("who are you?\n"); - exit(X_ABORT); + exit(X_STARTUP); } } if ((cp = strchr(rmtpeer, '@')) != NULL) { tuser = rmtpeer; *cp = '\0'; if (!okname(tuser)) - exit(X_ABORT); + exit(X_STARTUP); rmtpeer = ++cp; } else tuser = pwd->pw_name; diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 1e702c5..0807b58 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: main.c,v 1.16 1998/06/15 06:58:10 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -159,7 +159,7 @@ main(argc, argv) */ if ( ntrec > 64 ) { msg("please choose a blocksize <= 64\n"); - exit(X_ABORT); + exit(X_STARTUP); } break; @@ -200,7 +200,7 @@ main(argc, argv) if (spcl.c_ddate < 0) { (void)fprintf(stderr, "bad time \"%s\"\n", optarg); - exit(X_ABORT); + exit(X_STARTUP); } Tflag = 1; lastlevel = '?'; @@ -215,7 +215,7 @@ main(argc, argv) case 'W': /* what to do */ case 'w': lastdump(ch); - exit(0); /* do nothing else */ + exit(X_FINOK); /* do nothing else */ default: usage(); @@ -225,7 +225,7 @@ main(argc, argv) if (argc < 1) { (void)fprintf(stderr, "Must specify disk or filesystem\n"); - exit(X_ABORT); + exit(X_STARTUP); } disk = *argv++; argc--; @@ -234,12 +234,12 @@ main(argc, argv) while (argc--) (void)fprintf(stderr, " %s", *argv++); (void)fprintf(stderr, "\n"); - exit(X_ABORT); + exit(X_STARTUP); } if (Tflag && uflag) { (void)fprintf(stderr, "You cannot use the T and u flags together.\n"); - exit(X_ABORT); + exit(X_STARTUP); } if (strcmp(tape, "-") == 0) { pipeout++; @@ -272,13 +272,13 @@ main(argc, argv) #ifdef RDUMP if (index(tape, '\n')) { (void)fprintf(stderr, "invalid characters in tape\n"); - exit(X_ABORT); + exit(X_STARTUP); } if (rmthost(host) == 0) - exit(X_ABORT); + exit(X_STARTUP); #else (void)fprintf(stderr, "remote dump not enabled\n"); - exit(X_ABORT); + exit(X_STARTUP); #endif } (void)setuid(getuid()); /* rmthost() is the only reason to be setuid */ @@ -339,7 +339,7 @@ main(argc, argv) if ((diskfd = open(disk, O_RDONLY)) < 0) { msg("Cannot open %s\n", disk); - exit(X_ABORT); + exit(X_STARTUP); } sync(); sblock = (struct fs *)sblock_buf; @@ -506,7 +506,7 @@ usage() "nu] [-B records] [-b blocksize] [-d density] [-f file]\n" " [-h level] [-s feet] [-T date] filesystem\n" " dump [-W | -w]\n"); - exit(1); + exit(X_STARTUP); } /* |