* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.71 2002/07/29 12:00:33 stelian Exp $";
+ "$Id: tape.c,v 1.74 2003/03/30 15:40:37 stelian Exp $";
#endif /* not lint */
#include <config.h>
extern int cartridge;
char *nexttape;
extern pid_t rshpid;
-int eot_code = 1;
long long tapea_bytes = 0; /* bytes_written at start of current volume */
static int magtapeout; /* output is really a tape */
*(union u_spcl *)(*(nextblock)) = *(union u_spcl *)dp;
/* Need to write it to the archive file */
- if (Afile < 0 && isspcl && (spcl.c_type == TS_END))
- Afile = -Afile;
- if (Afile > 0) {
+ if (! AfileActive && isspcl && (spcl.c_type == TS_END))
+ AfileActive = 1;
+ if (AfileActive && Afile >= 0) {
/* When we dump an inode which is not a directory,
* it means we ended the archive contents */
if (isspcl && (spcl.c_type == TS_INODE) &&
((spcl.c_dinode.di_mode & S_IFMT) != IFDIR))
- Afile = -Afile;
+ AfileActive = 0;
else {
union u_spcl tmp;
tmp = *(union u_spcl *)dp;
blocks = spcl.c_tapea - tapea_volume;
msg("Volume %d completed at: %s", tapeno, ctime(&tnow));
if (! compressed)
- msg("Volume %d %ld tape blocks (%.2fMB)\n", tapeno,
+ msg("Volume %d %ld blocks (%.2fMB)\n", tapeno,
blocks, ((double)blocks * TP_BSIZE / 1048576));
if (ttaken > 0) {
long volkb = (bytes_written - tapea_bytes) / 1024;
(void) close(f);
}
}
- eot_code = 1;
- if (eot_script && spcl.c_type != TS_END) {
- msg("Launching %s\n", eot_script);
- eot_code = system_command(eot_script, tape, tapeno);
- }
- if (eot_code != 0 && eot_code != 1) {
- msg("Dump aborted by the end of tape script\n");
- dumpabort(0);
- }
}
return do_stats();
}
void
close_rewind(void)
{
+ int eot_code = 1;
(void)trewind();
- if (nexttape || Mflag || (eot_code == 0) )
+ if (nexttape || Mflag)
+ return;
+ if (eot_script) {
+ msg("Launching %s\n", eot_script);
+ eot_code = system_command(eot_script, tape, tapeno);
+ }
+ if (eot_code != 0 && eot_code != 1) {
+ msg("Dump aborted by the end of tape script\n");
+ dumpabort(0);
+ }
+ if (eot_code == 0)
return;
if (!nogripe) {
msg("Change Volumes: Mount volume #%d\n", tapeno+1);