#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.6 1999/10/13 09:57:20 stelian Exp $";
+ "$Id: tape.c,v 1.9 1999/11/21 16:01:47 tiniou Exp $";
#endif /* not lint */
#ifdef __linux__
int write(), read();
#endif
-#ifdef __linux__
+#ifdef __linux__
#include <ext2fs/ext2fs.h>
#endif
+
#include "dump.h"
int writesize; /* size of malloc()ed buffer for 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));
{
trewind();
(void)do_stats();
- if (nexttape)
+ if (nexttape || Mflag)
return;
if (!nogripe) {
msg("Change Volumes: Mount volume #%d\n", tapeno+1);
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",
* 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
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__ */
/*