projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_2 release
[unix-history]
/
usr
/
src
/
etc
/
dump
/
dumpmain.c
diff --git
a/usr/src/etc/dump/dumpmain.c
b/usr/src/etc/dump/dumpmain.c
index
c4a020b
..
3d225da
100644
(file)
--- a/
usr/src/etc/dump/dumpmain.c
+++ b/
usr/src/etc/dump/dumpmain.c
@@
-1,4
+1,4
@@
-static char *sccsid = "@(#)dumpmain.c 1.1
1 (Berkeley) 2/11
/83";
+static char *sccsid = "@(#)dumpmain.c 1.1
5 (Berkeley) 8/19
/83";
#include "dump.h"
int notify = 0; /* notify operator flag */
#include "dump.h"
int notify = 0; /* notify operator flag */
@@
-26,6
+26,7
@@
main(argc, argv)
tape = TAPE;
disk = DISK;
increm = NINCREM;
tape = TAPE;
disk = DISK;
increm = NINCREM;
+ temp = TEMP;
if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) {
msg("TP_BSIZE must be a multiple of DEV_BSIZE\n");
dumpabort();
if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) {
msg("TP_BSIZE must be a multiple of DEV_BSIZE\n");
dumpabort();
@@
-51,11
+52,6
@@
main(argc, argv)
exit(0); /* do nothing else */
break;
exit(0); /* do nothing else */
break;
- case 'J': /* update old to new */
- o_nconvert();
- exit(0); /* do nothing else */
- break;
-
case 'f': /* output file */
if(argc > 1) {
argv++;
case 'f': /* output file */
if(argc > 1) {
argv++;
@@
-115,7
+111,7
@@
main(argc, argv)
break;
default:
break;
default:
-
printf(
"bad key '%c%'\n", arg[-1]);
+
fprintf(stderr,
"bad key '%c%'\n", arg[-1]);
Exit(X_ABORT);
}
if(argc > 1) {
Exit(X_ABORT);
}
if(argc > 1) {
@@
-123,6
+119,10
@@
main(argc, argv)
argc--;
disk = *argv;
}
argc--;
disk = *argv;
}
+ if (strcmp(tape, "-") == 0) {
+ pipeout++;
+ tape = "standard output";
+ }
/*
* Determine how to default tape size and density
/*
* Determine how to default tape size and density
@@
-181,7
+181,8
@@
main(argc, argv)
getitime(); /* /etc/dumpdates snarfed */
msg("Date of this level %c dump: %s\n", incno, prdate(spcl.c_date));
getitime(); /* /etc/dumpdates snarfed */
msg("Date of this level %c dump: %s\n", incno, prdate(spcl.c_date));
- msg("Date of last level %c dump: %s\n", incno, prdate(spcl.c_ddate));
+ msg("Date of last level %c dump: %s\n",
+ lastincno, prdate(spcl.c_ddate));
msg("Dumping %s ", disk);
if (dt != 0)
msgtail("(%s) ", dt->fs_file);
msg("Dumping %s ", disk);
if (dt != 0)
msgtail("(%s) ", dt->fs_file);
@@
-247,7
+248,6
@@
main(argc, argv)
esize /* blocks */
* (1.0/ntrec) /* IRG's / block */
* tenthsperirg /* 0.1" / IRG */
esize /* blocks */
* (1.0/ntrec) /* IRG's / block */
* tenthsperirg /* 0.1" / IRG */
- * 7 /* 0.1" / IRG */
) * (1.0 / tsize ); /* tape / 0.1" */
}
etapes = fetapes; /* truncating assignment */
) * (1.0 / tsize ); /* tape / 0.1" */
}
etapes = fetapes; /* truncating assignment */
@@
-280,11
+280,14
@@
main(argc, argv)
putitime();
#ifndef RDUMP
putitime();
#ifndef RDUMP
- close(to);
+ if (!pipeout) {
+ close(to);
+ rewind();
+ }
#else
tflush(1);
#else
tflush(1);
-#endif
rewind();
rewind();
+#endif
broadcast("DUMP IS DONE!\7\7\n");
Exit(X_FINOK);
}
broadcast("DUMP IS DONE!\7\7\n");
Exit(X_FINOK);
}
@@
-299,6
+302,10
@@
int sigterm(){ msg("SIGTERM() try rewriting\n"); sigAbort();}
sigAbort()
{
sigAbort()
{
+ if (pipeout) {
+ msg("Unknown signal, cannot recover\n");
+ dumpabort();
+ }
msg("Rewriting attempted as response to unknown signal.\n");
fflush(stderr);
fflush(stdout);
msg("Rewriting attempted as response to unknown signal.\n");
fflush(stderr);
fflush(stdout);