]> git.wh0rd.org - dump.git/blobdiff - dump/tape.c
Copyright notice for Alcôve, for paying me to work on dump...
[dump.git] / dump / tape.c
index c1046674682714d459d00a25574d494fda3f9208..579ecd6eb209a931a95a0696edc45aae03ca69cf 100644 (file)
@@ -3,6 +3,7 @@
  *     dump and restore backup suit
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
  *     Stelian Pop <pop@cybercable.fr>, 1999-2000
+ *     Stelian Pop <pop@cybercable.fr> - Alcôve <www.alcove.fr>, 2000
  */
 
 /*-
@@ -40,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.20 2000/06/01 18:30:08 stelian Exp $";
+       "$Id: tape.c,v 1.24 2000/11/10 14:42:25 stelian Exp $";
 #endif /* not lint */
 
 #ifdef __linux__
@@ -877,9 +878,9 @@ Exit(int status)
 static void
 proceed(int signo)
 {
-       caught++;
        if (ready)
                siglongjmp(jmpbuf, 1);
+       caught++;
 }
 
 void
@@ -895,6 +896,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;
@@ -1081,6 +1084,7 @@ doslave(int cmd, int slave_number)
                if (wrote < 0) {
                        (void) kill(master, SIGUSR1);
                        sigemptyset(&sigset);
+                       sigaddset(&sigset, SIGINT);
                        for (;;)
                                sigsuspend(&sigset);
                } else {