X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftape.c;h=7790cc4e4bd6a30b8a8d6791699383265493195c;hb=d1c73b9a3cd598653eb8b13531e8ca3c5c740d90;hp=1b28c41e6e6307a9a9f662d36fc243c0b28045c3;hpb=f34aca37d19fe46de9acb22249565dfb6491ab2f;p=dump.git diff --git a/dump/tape.c b/dump/tape.c index 1b28c41..7790cc4 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.7 1999/11/02 09:35:56 tiniou Exp $"; + "$Id: tape.c,v 1.9 1999/11/21 16:01:47 tiniou Exp $"; #endif /* not lint */ #ifdef __linux__ @@ -81,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 */ @@ -457,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); @@ -711,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 @@ -908,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__ */ /*