Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Use the W* macros to test wait results.



details:   https://anonhg.NetBSD.org/src/rev/d1a1b7a073e0
branches:  trunk
changeset: 747116:d1a1b7a073e0
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Sep 03 06:45:23 2009 +0000

description:
Use the W* macros to test wait results.
(Mentioned by Joerg in chat a few days ago.)

diffstat:

 usr.bin/make/main.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r a9ca7db86787 -r d1a1b7a073e0 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Thu Sep 03 04:45:27 2009 +0000
+++ b/usr.bin/make/main.c       Thu Sep 03 06:45:23 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.171 2009/08/26 23:17:11 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.172 2009/09/03 06:45:23 dholland Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.171 2009/08/26 23:17:11 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.172 2009/09/03 06:45:23 dholland Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.171 2009/08/26 23:17:11 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.172 2009/09/03 06:45:23 dholland Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1557,7 +1557,9 @@
        if (cc == 0)
            *errnum = "Couldn't read shell's output for \"%s\"";
 
-       if (status)
+       if (WIFSIGNALED(status))
+           *errnum = "\"%s\" exited on a signal";
+       else if (WEXITSTATUS(status) != 0)
            *errnum = "\"%s\" returned non-zero status";
 
        /*



Home | Main Index | Thread Index | Old Index