]> git.wh0rd.org - dump.git/blobdiff - dump/tape.c
dump hang workaround.
[dump.git] / dump / tape.c
index 644ed8a2ba92ab6a555598b1c234086f6f34cf4c..71de659ba9f40cc8b60d243d209140155ea105f2 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.56 2001/09/12 09:02:51 stelian Exp $";
+       "$Id: tape.c,v 1.58 2001/11/17 10:44:18 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1040,6 +1040,12 @@ doslave(int cmd, int slave_number, int first)
        union u_spcl *uspclptr;
        struct s_spcl *spclptr;
 #endif /* USE_QFA */
+       sigset_t set;
+
+       sigemptyset(&set);
+       sigaddset(&set, SIGUSR2);
+       sigprocmask(SIG_BLOCK, &set, NULL);
+       sigemptyset(&set);
 
        /*
         * Need our own seek pointer.
@@ -1122,6 +1128,7 @@ doslave(int cmd, int slave_number, int first)
                if (compressed && do_compress) {
                        comp_buf->length = bufsize;
                        worklen = TP_BSIZE + writesize;
+                       compresult = 1;
 #ifdef HAVE_ZLIB
                        if (!bzipflag) {
                                compresult = compress2(comp_buf->buf, 
@@ -1177,7 +1184,7 @@ doslave(int cmd, int slave_number, int first)
                if (sigsetjmp(jmpbuf, 1) == 0) {
                        ready = 1;
                        if (!caught)
-                               (void) pause();
+                               sigsuspend(&set);
                }
                ready = 0;
                caught = 0;