Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src Pull up revision 1.31 (requested by jmc in ticket #527):



details:   https://anonhg.NetBSD.org/src/rev/3c1069258343
branches:  netbsd-2-0
changeset: 561523:3c1069258343
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jun 22 07:22:39 2004 +0000

description:
Pull up revision 1.31 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944

diffstat:

 bin/pax/ftree.c        |  8 +++++---
 tools/compat/Makefile  |  7 ++-----
 usr.sbin/mtree/mtree.c |  8 ++++++--
 3 files changed, 13 insertions(+), 10 deletions(-)

diffs (94 lines):

diff -r 7eabf5c650a7 -r 3c1069258343 bin/pax/ftree.c
--- a/bin/pax/ftree.c   Tue Jun 22 07:22:16 2004 +0000
+++ b/bin/pax/ftree.c   Tue Jun 22 07:22:39 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.29 2003/10/27 00:12:41 lukem Exp $ */
+/*     $NetBSD: ftree.c,v 1.29.2.1 2004/06/22 07:22:39 tron Exp $      */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)ftree.c    8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ftree.c,v 1.29 2003/10/27 00:12:41 lukem Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.29.2.1 2004/06/22 07:22:39 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -513,7 +513,7 @@
                        statbuf.st_flags = ftnode->st_flags;
 #endif
                if (ftnode->flags & F_TIME)
-#ifdef BSD4_4
+#if BSD4_4 && !HAVE_NBTOOL_CONFIG_H
                        statbuf.st_mtimespec = ftnode->st_mtimespec;
 #else
                        statbuf.st_mtime = ftnode->st_mtimespec.tv_sec;
@@ -717,6 +717,7 @@
                        arcn->ln_name[cnt] = '\0';
                        arcn->ln_nlen = cnt;
                        break;
+#ifdef S_IFSOCK
                case S_IFSOCK:
                        /*
                         * under BSD storing a socket is senseless but we will
@@ -725,6 +726,7 @@
                         */
                        arcn->type = PAX_SCK;
                        break;
+#endif
                case S_IFIFO:
                        arcn->type = PAX_FIF;
                        break;
diff -r 7eabf5c650a7 -r 3c1069258343 tools/compat/Makefile
--- a/tools/compat/Makefile     Tue Jun 22 07:22:16 2004 +0000
+++ b/tools/compat/Makefile     Tue Jun 22 07:22:39 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.28 2003/10/27 00:12:42 lukem Exp $
+#      $NetBSD: Makefile,v 1.28.2.1 2004/06/22 07:22:39 tron Exp $
 
 HOSTLIB=       nbcompat
 
@@ -23,11 +23,8 @@
 # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
 # other file ops, on many systems, without changing function names.
 
-# -D_NETBSD_SOURCE is necessary for some of the NetBSD headers that we
-# also use on the host system.
-
 CPPFLAGS+=     -I. -I./include -I${.CURDIR} -DHAVE_NBTOOL_CONFIG_H=1 \
-               -D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE
+               -D_FILE_OFFSET_BITS=64
 
 .PATH:         ${.CURDIR}/../../lib/libc/gen \
                ${.CURDIR}/../../lib/libc/hash \
diff -r 7eabf5c650a7 -r 3c1069258343 usr.sbin/mtree/mtree.c
--- a/usr.sbin/mtree/mtree.c    Tue Jun 22 07:22:16 2004 +0000
+++ b/usr.sbin/mtree/mtree.c    Tue Jun 22 07:22:39 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mtree.c,v 1.30 2003/08/07 11:25:36 agc Exp $   */
+/*     $NetBSD: mtree.c,v 1.30.2.1 2004/06/22 07:22:39 tron Exp $      */
 
 /*-
  * Copyright (c) 1989, 1990, 1993
@@ -29,6 +29,10 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(__COPYRIGHT) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\n\
@@ -39,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)mtree.c    8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: mtree.c,v 1.30 2003/08/07 11:25:36 agc Exp $");
+__RCSID("$NetBSD: mtree.c,v 1.30.2.1 2004/06/22 07:22:39 tron Exp $");
 #endif
 #endif /* not lint */
 



Home | Main Index | Thread Index | Old Index