bug-gnulib
[Top][All Lists]
Advanced

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

Force EXIT_FAILURE to 1


From: Eric Blake
Subject: Force EXIT_FAILURE to 1
Date: Fri, 9 Mar 2007 18:20:46 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Is this patch acceptable?  Most platforms already use 1 for EXIT_FAILURE.  It 
fixes what are otherwise false negatives in the M4 testsuite.  It also makes it 
easier to use GNU applications with xargs (since POSIX requires xargs to behave 
differently when apps exit with 255 as compared with any other value) - ie. I 
consider NSK's definition to be a bug.  stdlib_.h is currently built 
unconditionally, so I didn't have to modify the .m4 files.

And I don't know why Matthew's posts seem to be dropped from bug-gnulib, but 
show up on m4-discuss:
http://www.nabble.com/GNU-M4-1.4.8b-released-%28beta-release%29-
tf3284454.html#a9397135

2007-03-09  Eric Blake  <address@hidden>

        * lib/stdlib_.h (EXIT_FAILURE): GNU code expects this to be 1, in
        spite of platforms like Tandem/NSK that define it to -1.

Index: lib/stdlib_.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/stdlib_.h,v
retrieving revision 1.5
diff -u -r1.5 stdlib_.h
--- lib/stdlib_.h       21 Feb 2007 00:02:37 -0000      1.5
+++ lib/stdlib_.h       9 Mar 2007 18:14:32 -0000
@@ -50,8 +50,13 @@
 #ifndef EXIT_SUCCESS
 # define EXIT_SUCCESS 0
 #endif
+/* Tandem/NSK defines EXIT_FAILURE to -1, which interferes with normal xargs
+   operation.  */
 #ifndef EXIT_FAILURE
 # define EXIT_FAILURE 1
+#elif EXIT_FAILURE != 1
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
 #endif
 
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]