Module Name: src
Committed By: christos
Date: Tue Feb 26 00:45:28 UTC 2013
Modified Files:
src/usr.bin/make: job.c main.c
Log Message:
PR/45042: Thomas Cort: HAVE_foo for setrlimit(2) and setpgid(2)
To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/usr.bin/make/job.c
cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.169 src/usr.bin/make/job.c:1.170
--- src/usr.bin/make/job.c:1.169 Wed Feb 6 11:36:01 2013
+++ src/usr.bin/make/job.c Mon Feb 25 19:45:27 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.169 2013/02/06 16:36:01 christos Exp $ */
+/* $NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.169 2013/02/06 16:36:01 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.169 2013/02/06 16:36:01 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -1376,12 +1376,14 @@ JobExec(Job *job, char **argv)
* we can kill it and all its descendants in one fell swoop,
* by killing its process family, but not commit suicide.
*/
+#if defined(MAKE_NATIVE) || defined(HAVE_SETPGID)
#if defined(SYSV)
/* XXX: dsl - I'm sure this should be setpgrp()... */
(void)setsid();
#else
(void)setpgid(0, getpid());
#endif
+#endif
Var_ExportVars();
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.208 src/usr.bin/make/main.c:1.209
--- src/usr.bin/make/main.c:1.208 Sun Feb 24 19:15:09 2013
+++ src/usr.bin/make/main.c Mon Feb 25 19:45:27 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.208 2013/02/25 00:15:09 dholland Exp $ */
+/* $NetBSD: main.c,v 1.209 2013/02/26 00:45:27 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.208 2013/02/25 00:15:09 dholland Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.209 2013/02/26 00:45:27 christos Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.208 2013/02/25 00:15:09 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.209 2013/02/26 00:45:27 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -799,7 +799,7 @@ main(int argc, char **argv)
progname++;
else
progname = argv[0];
-#ifdef RLIMIT_NOFILE
+#if defined(MAKE_NATIVE) || (defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE))
/*
* get rid of resource limit on file descriptors
*/