From: millert Date: Tue, 25 Mar 1997 09:30:19 +0000 (+0000) Subject: Back out my previous kludge to make tar files with short trailers work in X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d22c2939d3696d743853db89f08f7ad8caf48f73;p=openbsd Back out my previous kludge to make tar files with short trailers work in favor of a simpler change--never try to do a media change when invoked as tar. This fixes problems that crop up if gzip exits unhappily and others. --- diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index 0029cfd767d..97b91a61510 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_io.c,v 1.12 1997/03/02 20:42:56 tholo Exp $ */ +/* $OpenBSD: ar_io.c,v 1.13 1997/03/25 09:30:19 millert Exp $ */ /* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ar_io.c,v 1.12 1997/03/02 20:42:56 tholo Exp $"; +static char rcsid[] = "$OpenBSD: ar_io.c,v 1.13 1997/03/25 09:30:19 millert Exp $"; #endif #endif /* not lint */ @@ -1186,7 +1186,7 @@ ar_next() if (sigprocmask(SIG_SETMASK, &o_mask, (sigset_t *)NULL) < 0) syswarn(0, errno, "Unable to restore signal mask"); - if (done || !wr_trail) + if (done || !wr_trail || strcmp(NM_TAR, argv0) == 0) return(-1); tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0); diff --git a/bin/pax/tar.c b/bin/pax/tar.c index 02cd066c928..d0454cf89ff 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tar.c,v 1.6 1997/02/16 06:54:21 tholo Exp $ */ +/* $OpenBSD: tar.c,v 1.7 1997/03/25 09:30:22 millert Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: tar.c,v 1.6 1997/02/16 06:54:21 tholo Exp $"; +static char rcsid[] = "$OpenBSD: tar.c,v 1.7 1997/03/25 09:30:22 millert Exp $"; #endif #endif /* not lint */ @@ -157,7 +157,7 @@ tar_trail(buf, in_resync, cnt) * might as well throw this block out since a valid header can NEVER be * a block of all 0 (we must have a valid file name). */ - if (!in_resync) + if (!in_resync && (++*cnt >= NULLCNT)) return(0); return(1); }