X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftape.c;h=63b64260db1d73cf928b5dd426def5feaf650771;hb=bd73117103358c5ee4f02a8fad5dc45123c7a5cc;hp=69715003e67bf772103bfad8d0b5d996a64c03ec;hpb=30a43325fdf58f596d4219fcabb6d46b8d884bdf;p=dump.git diff --git a/dump/tape.c b/dump/tape.c index 6971500..63b6426 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.19 2000/05/28 16:24:14 stelian Exp $"; + "$Id: tape.c,v 1.23 2000/08/30 08:55:21 stelian Exp $"; #endif /* not lint */ #ifdef __linux__ @@ -422,7 +422,11 @@ int system_command(const char *command, const char *device, int volnum) { if (pid == 0) { setuid(getuid()); setgid(getgid()); +#if OLD_STYLE_FSCRIPT + snprintf(commandstr, sizeof(commandstr), "%s", command); +#else snprintf(commandstr, sizeof(commandstr), "%s %s %d", command, device, volnum); +#endif commandstr[sizeof(commandstr) - 1] = '\0'; execl("/bin/sh", "sh", "-c", commandstr, NULL); perror(" DUMP: unable to execute shell"); @@ -873,9 +877,9 @@ Exit(int status) static void proceed(int signo) { - caught++; if (ready) siglongjmp(jmpbuf, 1); + caught++; } void @@ -891,6 +895,8 @@ enslave(void) master = getpid(); { struct sigaction sa; + memset(&sa, 0, sizeof sa); + sigemptyset(&sa.sa_mask); sa.sa_handler = dumpabort; sigaction(SIGTERM, &sa, NULL); /* Slave sends SIGTERM on dumpabort() */ sa.sa_handler = sigpipe; @@ -1077,6 +1083,7 @@ doslave(int cmd, int slave_number) if (wrote < 0) { (void) kill(master, SIGUSR1); sigemptyset(&sigset); + sigaddset(&sigset, SIGINT); for (;;) sigsuspend(&sigset); } else {