X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftape.c;h=7790cc4e4bd6a30b8a8d6791699383265493195c;hb=ae58c8dae642091208466d57d83e7ed02f1b8e71;hp=741f2de25ad442a1fcf58cd183beea2945662556;hpb=8d4197bb9ba5bbcef21409231ed8903b0cac353a;p=dump.git diff --git a/dump/tape.c b/dump/tape.c index 741f2de..7790cc4 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -2,8 +2,7 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999 - * + * Stelian Pop , 1999 */ /*- @@ -40,11 +39,8 @@ */ #ifndef lint -#if 0 -static char sccsid[] = "@(#)tape.c 8.4 (Berkeley) 5/1/95"; -#endif static const char rcsid[] = - "$Id: tape.c,v 1.4 1999/10/11 13:08:08 stelian Exp $"; + "$Id: tape.c,v 1.9 1999/11/21 16:01:47 tiniou Exp $"; #endif /* not lint */ #ifdef __linux__ @@ -85,9 +81,10 @@ static const char rcsid[] = int write(), read(); #endif -#ifdef __linux__ +#ifdef __linux__ #include #endif + #include "dump.h" int writesize; /* size of malloc()ed buffer for tape */ @@ -99,6 +96,7 @@ extern int ntrec; /* blocking factor on tape */ extern int cartridge; extern char *host; char *nexttape; +extern pid_t rshpid; static ssize_t atomic_read __P((int, void *, size_t)); static ssize_t atomic_write __P((int, const void *, size_t)); @@ -460,7 +458,7 @@ close_rewind(void) { trewind(); (void)do_stats(); - if (nexttape) + if (nexttape || Mflag) return; if (!nogripe) { msg("Change Volumes: Mount volume #%d\n", tapeno+1); @@ -665,7 +663,8 @@ restore_check_point: tapeno+1, parentpid, childpid); #endif /* TDEBUG */ while ((waitpid = wait(&status)) != childpid) - msg("Parent %d waiting for child %d has another child %d return\n", + if (waitpid != rshpid) + msg("Parent %d waiting for child %d has another child %d return\n", parentpid, childpid, waitpid); if (status & 0xFF) { msg("Child %d returns LOB status %o\n", @@ -713,14 +712,21 @@ restore_check_point: * the remaining names for subsequent volumes. */ tapeno++; /* current tape sequence */ - if (nexttape || strchr(tape, ',')) { + if (Mflag) { + snprintf(tape, NAME_MAX, "%s%03d", tapeprefix, tapeno); + tape[NAME_MAX - 1] = '\0'; + msg("Dumping volume %d on %s\n", tapeno, tape); + } + else if (nexttape || strchr(tapeprefix, ',')) { if (nexttape && *nexttape) - tape = nexttape; - if ((p = strchr(tape, ',')) != NULL) { + tapeprefix = nexttape; + if ((p = strchr(tapeprefix, ',')) != NULL) { *p = '\0'; nexttape = p + 1; } else nexttape = NULL; + strncpy(tape, tapeprefix, NAME_MAX); + tape[NAME_MAX - 1] = '\0'; msg("Dumping volume %d on %s\n", tapeno, tape); } #ifdef RDUMP @@ -910,9 +916,9 @@ doslave(int cmd, int slave_number) quit("slave couldn't reopen disk: %s\n", strerror(errno)); #ifdef __linux__ ext2fs_close(fs); - retval = ext2fs_open(disk, 0, 0, 0, unix_io_manager, &fs); + retval = dump_fs_open(disk, &fs); if (retval) - quit("slave couldn't reopen disk: %s\n", strerror(errno)); + quit("slave couldn't reopen disk: %s\n", error_message(retval)); #endif /* __linux__ */ /*