]> git.wh0rd.org - dump.git/blobdiff - dump/tape.c
Fix some compile warnings.
[dump.git] / dump / tape.c
index 156abffc99ed843bbf03cb77f8341cb8e2951a2e..116b4a3016e0f9d523f81769c4d0cfbaeca83cb2 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.80 2004/01/27 10:37:29 stelian Exp $";
+       "$Id: tape.c,v 1.83 2004/04/21 09:15:08 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -485,7 +485,7 @@ flushtape(void)
        blockswritten += ntrec;
        blocksthisvol += ntrec;
        if (!pipeout && !unlimited) {
-               if (blocksperfiles[blocksperfiles_current]) {
+               if (blocksperfiles && blocksperfiles[blocksperfiles_current]) {
                        if ( compressed ? (bytes_written - tapea_bytes + SLAVES * (writesize + sizeof(struct tapebuf))) >= (((long long)blocksperfiles[blocksperfiles_current]) * 1024)
                                        : blocksthisvol >= blocksperfiles[blocksperfiles_current] ) {
                                close_rewind();
@@ -573,8 +573,6 @@ close_rewind(void)
 {
        int eot_code = 1;
        (void)trewind();
-       if (nexttape || Mflag)
-               return;
        if (eot_script) {
                msg("Launching %s\n", eot_script);
                eot_code = system_command(eot_script, tape, tapeno);
@@ -585,6 +583,8 @@ close_rewind(void)
        }
        if (eot_code == 0)
                return;
+       if (nexttape || Mflag)
+               return;
        if (!nogripe) {
                msg("Change Volumes: Mount volume #%d\n", tapeno+1);
                broadcast("CHANGE DUMP VOLUMES!\7\7\n");
@@ -872,7 +872,7 @@ restore_check_point:
                        tape[MAXPATHLEN - 1] = '\0';
                        msg("Dumping volume %d on %s\n", tapeno, tape);
                }
-               if (blocksperfiles_current < *blocksperfiles)
+               if (blocksperfiles && blocksperfiles_current < *blocksperfiles)
                        blocksperfiles_current++;
 #ifdef RDUMP
                while ((tapefd = (host ? rmtopen(tape, O_WRONLY|O_CREAT|O_TRUNC) : pipeout ? 
@@ -1087,9 +1087,6 @@ doslave(int cmd,
        int compresult;
        volatile int do_compress = !first;
        unsigned long worklen;
-#ifdef HAVE_BZLIB
-       unsigned int worklen2;
-#endif
 #ifdef HAVE_LZO
        lzo_align_t __LZO_MMODEL *LZO_WorkMem;
 #endif
@@ -1226,7 +1223,7 @@ doslave(int cmd,
 #endif /* HAVE_ZLIB */
 #ifdef HAVE_BZLIB
                        if (zipflag == COMPRESS_BZLIB) {
-                               worklen2 = worklen;
+                               unsigned int worklen2 = worklen;
                                compresult = BZ2_bzBuffToBuffCompress(
                                                       comp_buf->buf,
                                                       &worklen2,
@@ -1244,10 +1241,12 @@ doslave(int cmd,
 #endif /* HAVE_BZLIB */
 #ifdef HAVE_LZO
                        if (zipflag == COMPRESS_LZO) {
+                               lzo_uint worklen2 = worklen;
                                compresult = lzo1x_1_compress((char *)slp->tblock[0],writesize,
                                                               comp_buf->buf,
-                                                             (lzo_uintp)&worklen,
+                                                             &worklen2,
                                                               LZO_WorkMem);
+                               worklen = worklen2;
                                if (compresult == LZO_E_OK)
                                        compresult = 1;
                                else