summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2005-08-04 10:02:45 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2005-08-04 10:02:45 +0000
commit4d7b4c4a2271e1108ea301a6d53b5dd698eca085 (patch)
tree76543cb5c97c233414293a27c8a25cca800bb1a8
parent26f08471345c3acb83f0fd8c3c9c99c249e47bfe (diff)
Make pax exit unsuccessfully on errors.
Patch by fgsch@ and me. Fixes PR 4310. OK fgsch@ otto@ millert@
-rw-r--r--bin/pax/ar_io.c12
-rw-r--r--bin/pax/pax.c6
2 files changed, 9 insertions, 9 deletions
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index 73cd5f8f618..2b52bd6d738 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar_io.c,v 1.36 2004/06/20 16:22:08 niklas Exp $ */
+/* $OpenBSD: ar_io.c,v 1.37 2005/08/04 10:02:44 mpf Exp $ */
/* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else
-static const char rcsid[] = "$OpenBSD: ar_io.c,v 1.36 2004/06/20 16:22:08 niklas Exp $";
+static const char rcsid[] = "$OpenBSD: ar_io.c,v 1.37 2005/08/04 10:02:44 mpf Exp $";
#endif
#endif /* not lint */
@@ -122,7 +122,7 @@ ar_open(const char *name)
arfd = STDIN_FILENO;
arcname = STDN;
} else if ((arfd = open(name, EXT_MODE, DMOD)) < 0)
- syswarn(0, errno, "Failed open to read on %s", name);
+ syswarn(1, errno, "Failed open to read on %s", name);
if (arfd != -1 && gzip_program != NULL)
ar_start_gzip(arfd, gzip_program, 0);
break;
@@ -131,7 +131,7 @@ ar_open(const char *name)
arfd = STDOUT_FILENO;
arcname = STDO;
} else if ((arfd = open(name, AR_MODE, DMOD)) < 0)
- syswarn(0, errno, "Failed open to write on %s", name);
+ syswarn(1, errno, "Failed open to write on %s", name);
else
can_unlnk = 1;
if (arfd != -1 && gzip_program != NULL)
@@ -142,7 +142,7 @@ ar_open(const char *name)
arfd = STDOUT_FILENO;
arcname = STDO;
} else if ((arfd = open(name, APP_MODE, DMOD)) < 0)
- syswarn(0, errno, "Failed open to read/write on %s",
+ syswarn(1, errno, "Failed open to read/write on %s",
name);
break;
case COPY:
@@ -165,7 +165,7 @@ ar_open(const char *name)
* set up is based on device type
*/
if (fstat(arfd, &arsb) < 0) {
- syswarn(0, errno, "Failed stat on %s", arcname);
+ syswarn(1, errno, "Failed stat on %s", arcname);
(void)close(arfd);
arfd = -1;
can_unlnk = 0;
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
index 4343462fa18..3c3d2b47197 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pax.c,v 1.27 2004/04/16 22:50:23 deraadt Exp $ */
+/* $OpenBSD: pax.c,v 1.28 2005/08/04 10:02:44 mpf Exp $ */
/* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */
/*-
@@ -44,7 +44,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#else
-static const char rcsid[] = "$OpenBSD: pax.c,v 1.27 2004/04/16 22:50:23 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: pax.c,v 1.28 2005/08/04 10:02:44 mpf Exp $";
#endif
#endif /* not lint */
@@ -240,7 +240,7 @@ main(int argc, char **argv)
*/
cwdfd = open(".", O_RDONLY);
if (cwdfd < 0) {
- syswarn(0, errno, "Can't open current working directory.");
+ syswarn(1, errno, "Can't open current working directory.");
return(exit_val);
}