From: Peter Collinson Date: Wed, 5 Aug 1987 04:52:24 +0000 (-0800) Subject: Changes from Kirk McKusick X-Git-Tag: BSD-4_3_Net_1-Snapshot-Development~3860 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/73181f721f2eaca23a4c0ceb11a32a560fd3af74 Changes from Kirk McKusick SCCS-vsn: local/ukc/dump/dumpmain.c 1.2 SCCS-vsn: local/ukc/dump/dumptape.c 1.2 --- diff --git a/usr/src/local/ukc/dump/dumpmain.c b/usr/src/local/ukc/dump/dumpmain.c index 756716ec32..367b944f19 100644 --- a/usr/src/local/ukc/dump/dumpmain.c +++ b/usr/src/local/ukc/dump/dumpmain.c @@ -5,7 +5,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)dumpmain.c 5.4 (Berkeley) 5/28/86"; +static char sccsid[] = "@(#)dumpmain.c 5.6 (Berkeley) 2/23/87"; #endif not lint #include "dump.h" @@ -191,8 +191,18 @@ main(argc, argv) * the file system name with or without the leading '/'. */ dt = fstabsearch(disk); - if (dt != 0) + if (dt != 0) { disk = rawname(dt->fs_spec); + strncpy(spcl.c_dev, dt->fs_spec, NAMELEN); + strncpy(spcl.c_filesys, dt->fs_file, NAMELEN); + } else { + strncpy(spcl.c_dev, disk, NAMELEN); + strncpy(spcl.c_filesys, "an unlisted file system", NAMELEN); + } + strcpy(spcl.c_label, "none"); + gethostname(spcl.c_host, NAMELEN); + spcl.c_level = incno - '0'; + spcl.c_type = TS_TAPE; getitime(); /* /etc/dumpdates snarfed */ msg("Date of this level %c dump: %s\n", incno, prdate(spcl.c_date)); diff --git a/usr/src/local/ukc/dump/dumptape.c b/usr/src/local/ukc/dump/dumptape.c index 3031785d82..49e1d163eb 100644 --- a/usr/src/local/ukc/dump/dumptape.c +++ b/usr/src/local/ukc/dump/dumptape.c @@ -5,15 +5,16 @@ */ #ifndef lint -static char sccsid[] = "@(#)dumptape.c 5.5 (Berkeley) 5/23/86"; +static char sccsid[] = "@(#)dumptape.c 5.8 (Berkeley) 2/23/87"; #endif not lint #include #include "dump.h" -char (*tblock)[TP_BSIZE]; /* Pointer to malloc()ed buffer for tape */ -int writesize; /* Size of malloc()ed buffer for tape */ -int trecno = 0; +char (*tblock)[TP_BSIZE]; /* pointer to malloc()ed buffer for tape */ +int writesize; /* size of malloc()ed buffer for tape */ +long lastspclrec = -1; /* tape block number of last written header */ +int trecno = 0; /* next record to write in current block */ extern int ntrec; /* blocking factor on tape */ extern int cartridge; extern int read(), write(); @@ -74,6 +75,7 @@ taprec(dp) req[trecno].dblk = (daddr_t)0; req[trecno].count = 1; *(union u_spcl *)(*tblock++) = *(union u_spcl *)dp; /* movc3 */ + lastspclrec = spcl.c_tapea; trecno++; spcl.c_tapea++; if(trecno >= ntrec) @@ -218,6 +220,7 @@ otape() int status; int waitpid; int (*interrupt)() = signal(SIGINT, SIG_IGN); + int blks, i; parentpid = getpid(); @@ -300,9 +303,17 @@ otape() asize = 0; tapeno++; /* current tape sequence */ newtape++; /* new tape signal */ + blks = 0; + if (spcl.c_type != TS_END) + for (i = 0; i < spcl.c_count; i++) + if (spcl.c_addr[i] != 0) + blks++; + spcl.c_count = blks + 1 - spcl.c_tapea + lastspclrec; spcl.c_volume++; spcl.c_type = TS_TAPE; + spcl.c_flags |= DR_NEWHEADER; spclrec(); + spcl.c_flags &=~ DR_NEWHEADER; if (tapeno > 1) msg("Tape %d begins with blocks from ino %d\n", tapeno, ino);