X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fbuffer.c;h=e0ffc2d28654d7cd4d6dc9782370b9fe41c3ab3b;hb=2f65bfa9c2b906b2b709e279cedcffb78cee015b;hp=5f454b96a6a462563343e90bda1617887cd9fc34;hpb=9044aa8d8155f8450b9b7a7e15346e039c134cab;p=chaz%2Ftar diff --git a/src/buffer.c b/src/buffer.c index 5f454b9..e0ffc2d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,5 +1,5 @@ /* Buffer management for tar. - Copyright (C) 1988, 1992 Free Software Foundation + Copyright (C) 1988, 1992, 1993 Free Software Foundation This file is part of GNU Tar. @@ -265,7 +265,6 @@ child_open () { int pipe[2]; int err = 0; - int nar; int kidpipe[2]; int kidchildpid; @@ -441,11 +440,12 @@ child_open () { if (err < 0) { - msg_perror ("can't write to compress"); + msg_perror ("can't write to compression program"); exit (EX_SYSTEM); } else - msg ("write to compress short %d bytes", count - err); + msg ("write to compression program short %d bytes", + count - err); count = (err < 0) ? 0 : err; } ptr += count; @@ -473,20 +473,20 @@ child_open () /* EOF */ if (err == 0) { - if (f_compress < 2) + if (!f_compress_block) blocksize -= n; else bzero (ar_block->charptr + blocksize - n, n); err = rmtwrite (archive, ar_block->charptr, blocksize); if (err != (blocksize)) writeerror (err); - if (f_compress < 2) + if (!f_compress_block) blocksize += n; break; } if (n) { - msg_perror ("can't read from compress"); + msg_perror ("can't read from compression program"); exit (EX_SYSTEM); } err = rmtwrite (archive, ar_block->charptr, (int) blocksize); @@ -501,10 +501,10 @@ child_open () } /* So we should exec compress (-d) */ if (ar_reading) - execlp ("compress", "compress", "-d", (char *) 0); + execlp (f_compressprog, f_compressprog, "-d", (char *) 0); else - execlp ("compress", "compress", (char *) 0); - msg_perror ("can't exec compress"); + execlp (f_compressprog, f_compressprog, (char *) 0); + msg_perror ("can't exec %s", f_compressprog); _exit (EX_SYSTEM); } @@ -574,7 +574,7 @@ open_archive (reading) exit (EX_ARGSBAD); } - if (f_compress) + if (f_compressprog) { if (reading == 2 || f_verify) { @@ -698,6 +698,7 @@ open_archive (reading) sprintf (ar_block->header.arch_name, "%s Volume 1", f_volhdr); else strcpy (ar_block->header.arch_name, f_volhdr); + current_file_name = ar_block->header.arch_name; ar_block->header.linkflag = LF_VOLHDR; to_oct (time (0), 1 + 12, ar_block->header.mtime); finish_header (ar_block); @@ -1285,10 +1286,10 @@ close_archive () if (WEXITSTATUS (status) == (SIGPIPE + 128)) { /* - * /bin/sh returns this if its child - * dies with SIGPIPE. 'Sok. - */ - break; + * /bin/sh returns this if its child + * dies with SIGPIPE. 'Sok. + */ + /* Do nothing. */ } else if (WEXITSTATUS (status)) msg ("child returned status %d", @@ -1362,7 +1363,7 @@ anno (stream, prefix, savedp) #endif /* Called to initialize the global volume number. */ -int +void init_volume_number () { FILE *vf; @@ -1379,7 +1380,7 @@ init_volume_number () } /* Called to write out the closing global volume number. */ -int +void closeout_volume_number () { FILE *vf; @@ -1432,7 +1433,10 @@ tryagain: { /* We have to prompt from now on. */ if (f_run_script_at_end) - system (info_script); + { + closeout_volume_number (); + system (info_script); + } else for (;;) {