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.35 (requested by jmc in ticket #527):
details: https://anonhg.NetBSD.org/src/rev/6d62514e601f
branches: netbsd-2-0
changeset: 561525:6d62514e601f
user: tron <tron%NetBSD.org@localhost>
date: Tue Jun 22 07:23:25 2004 +0000
description:
Pull up revision 1.35 (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/pax.c | 32 +++++++++++++++++++++++++-------
usr.bin/m4/main.c | 8 ++++++--
usr.bin/xlint/xlint/xlint.c | 8 ++++++--
3 files changed, 37 insertions(+), 11 deletions(-)
diffs (132 lines):
diff -r a9b1885bdb85 -r 6d62514e601f bin/pax/pax.c
--- a/bin/pax/pax.c Tue Jun 22 07:23:02 2004 +0000
+++ b/bin/pax/pax.c Tue Jun 22 07:23:25 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pax.c,v 1.33 2004/02/13 23:10:14 matt Exp $ */
+/* $NetBSD: pax.c,v 1.33.2.1 2004/06/22 07:23:25 tron Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -44,7 +44,7 @@
#if 0
static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#else
-__RCSID("$NetBSD: pax.c,v 1.33 2004/02/13 23:10:14 matt Exp $");
+__RCSID("$NetBSD: pax.c,v 1.33.2.1 2004/06/22 07:23:25 tron Exp $");
#endif
#endif /* not lint */
@@ -337,9 +337,11 @@
* will clearly see the message on a line by itself.
*/
vflag = vfpart = 1;
+#ifdef SIGXCPU
if (which_sig == SIGXCPU)
tty_warn(0, "CPU time limit reached, cleaning up.");
else
+#endif
tty_warn(0, "Signal caught, cleaning up.");
/* delete any open temporary file */
@@ -416,11 +418,23 @@
*/
if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) ||
(sigaddset(&s_mask,SIGINT) < 0)||(sigaddset(&s_mask,SIGHUP) < 0) ||
- (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0) ||
- (sigaddset(&s_mask,SIGXCPU) < 0)||(sigaddset(&s_mask,SIGXFSZ)<0)) {
+ (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0)){
+ tty_warn(1, "Unable to set up signal mask");
+ return(-1);
+ }
+#ifdef SIGXCPU
+ if (sigaddset(&s_mask,SIGXCPU) < 0) {
tty_warn(1, "Unable to set up signal mask");
return(-1);
}
+#endif
+#ifdef SIGXFSZ
+ if (sigaddset(&s_mask,SIGXFSZ) < 0) {
+ tty_warn(1, "Unable to set up signal mask");
+ return(-1);
+ }
+#endif
+
memset(&n_hand, 0, sizeof n_hand);
n_hand.sa_mask = s_mask;
n_hand.sa_flags = 0;
@@ -446,15 +460,19 @@
(sigaction(SIGQUIT, &o_hand, &o_hand) < 0))
goto out;
+#ifdef SIGXCPU
if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGXCPU, &o_hand, &o_hand) < 0))
goto out;
-
+#endif
n_hand.sa_handler = SIG_IGN;
- if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) ||
- (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0))
+ if (sigaction(SIGPIPE, &n_hand, &o_hand) < 0)
goto out;
+#ifdef SIGXFSZ
+ if (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)
+ goto out;
+#endif
return(0);
out:
diff -r a9b1885bdb85 -r 6d62514e601f usr.bin/m4/main.c
--- a/usr.bin/m4/main.c Tue Jun 22 07:23:02 2004 +0000
+++ b/usr.bin/m4/main.c Tue Jun 22 07:23:25 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.34 2003/08/07 11:14:32 agc Exp $ */
+/* $NetBSD: main.c,v 1.34.2.1 2004/06/22 07:23:25 tron Exp $ */
/* $OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $ */
/*-
@@ -33,6 +33,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, 1993\n\
@@ -43,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: main.c,v 1.34 2003/08/07 11:14:32 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.34.2.1 2004/06/22 07:23:25 tron Exp $");
#endif
#endif /* not lint */
diff -r a9b1885bdb85 -r 6d62514e601f usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c Tue Jun 22 07:23:02 2004 +0000
+++ b/usr.bin/xlint/xlint/xlint.c Tue Jun 22 07:23:25 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.34 2004/01/26 21:51:11 dsl Exp $ */
+/* $NetBSD: xlint.c,v 1.34.2.1 2004/06/22 07:23:26 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: xlint.c,v 1.34 2004/01/26 21:51:11 dsl Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.34.2.1 2004/06/22 07:23:26 tron Exp $");
#endif
#include <sys/param.h>
Home |
Main Index |
Thread Index |
Old Index