Make `dump' exit codes confirm to manual page.
PR: 5346 Style-check-by: bde
This commit is contained in:
parent
7842d15da6
commit
bf57a7d1d1
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user