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.17 (requested by jmc in ticket #527):



details:   https://anonhg.NetBSD.org/src/rev/70da8231e9c1
branches:  netbsd-2-0
changeset: 561520:70da8231e9c1
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jun 22 07:21:29 2004 +0000

description:
Pull up revision 1.17 (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:

 lib/libc/stdlib/getopt_long.c |  12 ++++++++++--
 usr.bin/m4/misc.c             |   8 ++++++--
 usr.bin/xlint/lint2/chk.c     |   8 ++++++--
 usr.sbin/config/mkswap.c      |   6 +++++-
 usr.sbin/makefs/walk.c        |  14 ++++++++++----
 5 files changed, 37 insertions(+), 11 deletions(-)

diffs (156 lines):

diff -r 813a17df1d23 -r 70da8231e9c1 lib/libc/stdlib/getopt_long.c
--- a/lib/libc/stdlib/getopt_long.c     Tue Jun 22 07:21:04 2004 +0000
+++ b/lib/libc/stdlib/getopt_long.c     Tue Jun 22 07:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getopt_long.c,v 1.16 2003/10/27 00:12:42 lukem Exp $   */
+/*     $NetBSD: getopt_long.c,v 1.16.2.1 2004/06/22 07:21:29 tron Exp $        */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,9 +36,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getopt_long.c,v 1.16 2003/10/27 00:12:42 lukem Exp $");
+__RCSID("$NetBSD: getopt_long.c,v 1.16.2.1 2004/06/22 07:21:29 tron Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -46,7 +50,11 @@
 #include <assert.h>
 #include <err.h>
 #include <errno.h>
+#if HAVE_NBTOOL_CONFIG_H
+#include "compat_getopt.h"
+#else
 #include <getopt.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
 
diff -r 813a17df1d23 -r 70da8231e9c1 usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Tue Jun 22 07:21:04 2004 +0000
+++ b/usr.bin/m4/misc.c Tue Jun 22 07:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: misc.c,v 1.16 2003/08/07 11:14:33 agc Exp $    */
+/*     $NetBSD: misc.c,v 1.16.2.1 2004/06/22 07:21:29 tron Exp $       */
 /*     $OpenBSD: misc.c,v 1.25 2001/10/10 11:17:37 espie Exp $ */
 
 /*
@@ -33,12 +33,16 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
 #if 0
 static char sccsid[] = "@(#)misc.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: misc.c,v 1.16 2003/08/07 11:14:33 agc Exp $");
+__RCSID("$NetBSD: misc.c,v 1.16.2.1 2004/06/22 07:21:29 tron Exp $");
 #endif
 #endif /* not lint */
 
diff -r 813a17df1d23 -r 70da8231e9c1 usr.bin/xlint/lint2/chk.c
--- a/usr.bin/xlint/lint2/chk.c Tue Jun 22 07:21:04 2004 +0000
+++ b/usr.bin/xlint/lint2/chk.c Tue Jun 22 07:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.16 2002/01/31 19:36:55 tv Exp $ */
+/* $NetBSD: chk.c,v 1.16.4.1 2004/06/22 07:21:29 tron Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -32,9 +32,13 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.16 2002/01/31 19:36:55 tv Exp $");
+__RCSID("$NetBSD: chk.c,v 1.16.4.1 2004/06/22 07:21:29 tron Exp $");
 #endif
 
 #include <ctype.h>
diff -r 813a17df1d23 -r 70da8231e9c1 usr.sbin/config/mkswap.c
--- a/usr.sbin/config/mkswap.c  Tue Jun 22 07:21:04 2004 +0000
+++ b/usr.sbin/config/mkswap.c  Tue Jun 22 07:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkswap.c,v 1.16 2003/08/07 11:25:16 agc Exp $  */
+/*     $NetBSD: mkswap.c,v 1.16.2.1 2004/06/22 07:21:29 tron Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,6 +40,10 @@
  *     from: @(#)mkswap.c      8.1 (Berkeley) 6/6/93
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/param.h>
 #include <errno.h>
 #include <stdio.h>
diff -r 813a17df1d23 -r 70da8231e9c1 usr.sbin/makefs/walk.c
--- a/usr.sbin/makefs/walk.c    Tue Jun 22 07:21:04 2004 +0000
+++ b/usr.sbin/makefs/walk.c    Tue Jun 22 07:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: walk.c,v 1.15 2003/09/19 06:11:35 itojun Exp $ */
+/*     $NetBSD: walk.c,v 1.15.2.1 2004/06/22 07:21:29 tron Exp $       */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,9 +71,13 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.15 2003/09/19 06:11:35 itojun Exp $");
+__RCSID("$NetBSD: walk.c,v 1.15.2.1 2004/06/22 07:21:29 tron Exp $");
 #endif /* !__lint */
 
 #include <sys/param.h>
@@ -129,11 +133,13 @@
                        errx(1, "Pathname too long.");
                if (lstat(path, &stbuf) == -1)
                        err(1, "Can't lstat `%s'", path);
+#ifdef S_ISSOCK
                if (S_ISSOCK(stbuf.st_mode & S_IFMT)) {
                        if (debug & DEBUG_WALK_DIR_NODE)
                                printf("  skipping socket %s\n", path);
                        continue;
                }
+#endif
 
                cur = create_fsnode(dent->d_name, &stbuf);
                cur->parent = parent;
@@ -401,8 +407,8 @@
                dirnode->inode->st.st_atime =           specnode->st_mtimespec.tv_sec;
                dirnode->inode->st.st_ctime =           start_time.tv_sec;
 #if HAVE_STRUCT_STAT_ST_MTIMENSEC
-               dirnode->inode->st.st_mtimensec =       specnode->st_mtimensec;
-               dirnode->inode->st.st_atimensec =       specnode->st_mtimensec;
+               dirnode->inode->st.st_mtimensec =       specnode->st_mtimespec.tv_nsec;
+               dirnode->inode->st.st_atimensec =       specnode->st_mtimespec.tv_nsec;
                dirnode->inode->st.st_ctimensec =       start_time.tv_nsec;
 #endif
        }



Home | Main Index | Thread Index | Old Index