aboutsummaryrefslogtreecommitdiff
path: root/sbin/dump
diff options
context:
space:
mode:
authorJoseph Koshy <jkoshy@FreeBSD.org>1998-07-14 09:19:47 +0000
committerJoseph Koshy <jkoshy@FreeBSD.org>1998-07-14 09:19:47 +0000
commitf69e804d242ecb9a84b54938464bec5bc2b9ee84 (patch)
tree3193fdd263e82610ffc5f1811b8b4cf98a754fa1 /sbin/dump
parentfa0bc432ca77ab1c318497532f1c191140f61483 (diff)
downloadsrc-f69e804d242ecb9a84b54938464bec5bc2b9ee84.tar.gz
src-f69e804d242ecb9a84b54938464bec5bc2b9ee84.zip
Make `dump' exit codes confirm to manual page.
PR: 5346 Style-check-by: bde
Notes
Notes: svn path=/head/; revision=37635
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/dump.h1
-rw-r--r--sbin/dump/dumprmt.c8
-rw-r--r--sbin/dump/main.c24
3 files changed, 17 insertions, 16 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h
index 6053198f57e7..2c907a957389 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 84fef1383889..f27d2143c0ab 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 1e702c58d86b..0807b5825780 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);
}
/*