[Midnightbsd-cvs] src [11194] trunk/bin/pax: sync

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 1 11:48:42 EDT 2018


Revision: 11194
          http://svnweb.midnightbsd.org/src/?rev=11194
Author:   laffer1
Date:     2018-07-01 11:48:41 -0400 (Sun, 01 Jul 2018)
Log Message:
-----------
sync

Modified Paths:
--------------
    trunk/bin/pax/Makefile
    trunk/bin/pax/ar_io.c
    trunk/bin/pax/ar_subs.c
    trunk/bin/pax/buf_subs.c
    trunk/bin/pax/cache.c
    trunk/bin/pax/cache.h
    trunk/bin/pax/cpio.c
    trunk/bin/pax/extern.h
    trunk/bin/pax/file_subs.c
    trunk/bin/pax/gen_subs.c

Modified: trunk/bin/pax/Makefile
===================================================================
--- trunk/bin/pax/Makefile	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/Makefile	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,6 +1,9 @@
+# $MidnightBSD$
 #       @(#)Makefile	8.1 (Berkeley) 5/31/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/bin/pax/Makefile 262951 2014-03-09 17:04:31Z jmmv $
 
+.include <bsd.own.mk>
+
 # To install on versions prior to BSD 4.4 the following may have to be
 # defined with CFLAGS +=
 #
@@ -30,4 +33,8 @@
 	gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \
 	tables.c tar.c tty_subs.c
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=    tests
+.endif
+
 .include <bsd.prog.mk>

Modified: trunk/bin/pax/ar_io.c
===================================================================
--- trunk/bin/pax/ar_io.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/ar_io.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -37,7 +38,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/bin/pax/ar_io.c 281661 2015-04-17 18:33:59Z eadler $");
 
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -82,10 +83,9 @@
 static int can_unlnk = 0;		/* do we unlink null archives?  */
 const char *arcname;		  	/* printable name of archive */
 const char *gzip_program;		/* name of gzip program */
-static pid_t zpid = -1;			/* pid of child process */
+static pid_t zpid = -1; 		/* pid of child process */
 
 static int get_phys(void);
-extern sigset_t s_mask;
 static void ar_start_gzip(int, const char *, int);
 
 /*
@@ -1124,7 +1124,7 @@
 	if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0)
 		syswarn(0, errno, "Unable to restore signal mask");
 
-	if (done || !wr_trail || strcmp(NM_TAR, argv0) == 0)
+	if (done || !wr_trail || Oflag || strcmp(NM_TAR, argv0) == 0)
 		return(-1);
 
 	tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0);

Modified: trunk/bin/pax/ar_subs.c
===================================================================
--- trunk/bin/pax/ar_subs.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/ar_subs.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -37,7 +38,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/bin/pax/ar_subs.c 284008 2015-06-05 00:39:34Z delphij $");
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -48,7 +49,6 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
-#include <stdlib.h>
 #include "pax.h"
 #include "extern.h"
 
@@ -55,7 +55,6 @@
 static void wr_archive(ARCHD *, int is_app);
 static int get_arc(void);
 static int next_head(ARCHD *);
-extern sigset_t s_mask;
 
 /*
  * Routines which control the overall operation modes of pax as specified by

Modified: trunk/bin/pax/buf_subs.c
===================================================================
--- trunk/bin/pax/buf_subs.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/buf_subs.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -37,7 +38,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/bin/pax/buf_subs.c 310606 2016-12-26 16:43:39Z pfg $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -44,7 +45,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include "pax.h"
 #include "extern.h"
@@ -853,10 +853,13 @@
 
 		/*
 		 * errors require resync, EOF goes to next archive
+		 * but in case we have not determined yet the format,
+		 * this means that we have a very short file, so we
+		 * are done again.
 		 */
 		if (cnt < 0)
 			break;
-		if (ar_next() < 0) {
+		if (frmt == NULL || ar_next() < 0) {
 			fini = 1;
 			return(0);
 		}

Modified: trunk/bin/pax/cache.c
===================================================================
--- trunk/bin/pax/cache.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/cache.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -37,7 +38,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/bin/pax/cache.c 284008 2015-06-05 00:39:34Z delphij $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -45,7 +46,6 @@
 #include <stdio.h>
 #include <pwd.h>
 #include <grp.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include "pax.h"
 #include "cache.h"

Modified: trunk/bin/pax/cache.h
===================================================================
--- trunk/bin/pax/cache.h	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/cache.h	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -31,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *      @(#)cache.h	8.1 (Berkeley) 5/31/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/bin/pax/cache.h 127958 2004-04-06 20:06:54Z markm $
  */
 
 /*

Modified: trunk/bin/pax/cpio.c
===================================================================
--- trunk/bin/pax/cpio.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/cpio.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -45,8 +45,6 @@
 #include <string.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include "pax.h"
 #include "cpio.h"
 #include "extern.h"

Modified: trunk/bin/pax/extern.h
===================================================================
--- trunk/bin/pax/extern.h	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/extern.h	2018-07-01 15:48:41 UTC (rev 11194)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1992 Keith Muller.
  * Copyright (c) 1992, 1993
@@ -31,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)extern.h	8.2 (Berkeley) 4/18/94
- * $MidnightBSD$
+ * $FreeBSD: stable/10/bin/pax/extern.h 281661 2015-04-17 18:33:59Z eadler $
  */
 
 /*
@@ -186,7 +187,7 @@
 OPLIST * opt_next(void);
 int opt_add(const char *);
 int bad_opt(void);
-char *chdname;
+extern char *chdname;
 
 /*
  * pat_rep.c
@@ -217,6 +218,7 @@
 extern int Dflag;
 extern int Hflag;
 extern int Lflag;
+extern int Oflag;
 extern int Xflag;
 extern int Yflag;
 extern int Zflag;
@@ -231,6 +233,7 @@
 extern int docrc;
 extern char *dirptr;
 extern const char *argv0;
+extern sigset_t s_mask;
 extern FILE *listf;
 extern char *tempfile;
 extern char *tempbase;

Modified: trunk/bin/pax/file_subs.c
===================================================================
--- trunk/bin/pax/file_subs.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/file_subs.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -48,7 +48,6 @@
 #include <stdio.h>
 #include <errno.h>
 #include <sys/uio.h>
-#include <stdlib.h>
 #include "pax.h"
 #include "options.h"
 #include "extern.h"

Modified: trunk/bin/pax/gen_subs.c
===================================================================
--- trunk/bin/pax/gen_subs.c	2018-07-01 15:47:35 UTC (rev 11193)
+++ trunk/bin/pax/gen_subs.c	2018-07-01 15:48:41 UTC (rev 11194)
@@ -45,8 +45,6 @@
 #include <langinfo.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <string.h>
 #include "pax.h"
 #include "extern.h"



More information about the Midnightbsd-cvs mailing list