bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] use exit.h rather than having each module define EXIT_FAILU


From: Paul Eggert
Subject: [Bug-gnulib] use exit.h rather than having each module define EXIT_FAILURE itself
Date: 12 Sep 2003 13:19:34 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

The exit module defines EXIT_FAILURE, but some other older modules
still do that themselves.  To clean things up I installed the
following patch so that EXIT_FAILURE is defined only by the exit
module.  This removes a FIXME in fatal.c.

I'm sorting the dependencies in the modules/* files as I go along; I
assume the existing order is immaterial, and if nobody else minds I'd
rather have them sorted for sanity's sake.

2003-09-12  Paul Eggert  <address@hidden>

        * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
        * obstack.c [!defined _LIBC]: Likewise.
        * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
        * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
        * exitfail.c: Don't include stdlib.h; no longer needed.
        * modules/argmatch, modules/exitfail, modules/obstack,
        modules/xgethostname, modules/xalloc: Depend on exit.

Index: lib/argmatch.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/argmatch.c,v
retrieving revision 1.31
diff -p -u -r1.31 argmatch.c
--- lib/argmatch.c      12 Sep 2003 18:28:18 -0000      1.31
+++ lib/argmatch.c      12 Sep 2003 20:05:24 -0000
@@ -35,6 +35,7 @@
 #define _(msgid) gettext (msgid)
 
 #include "error.h"
+#include "exit.h"
 #include "quotearg.h"
 #include "quote.h"
 #include "unlocked-io.h"
@@ -44,10 +45,6 @@
    literal_quoting_style.  */
 #ifndef ARGMATCH_QUOTING_STYLE
 # define ARGMATCH_QUOTING_STYLE locale_quoting_style
-#endif
-
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
 #endif
 
 /* Non failing version of argmatch call this function after failing. */
Index: lib/exitfail.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/exitfail.c,v
retrieving revision 1.2
diff -p -u -r1.2 exitfail.c
--- lib/exitfail.c      9 Sep 2003 03:34:40 -0000       1.2
+++ lib/exitfail.c      12 Sep 2003 20:05:24 -0000
@@ -21,9 +21,7 @@
 # include <config.h>
 #endif
 
-#include <stdlib.h>
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
+#include "exitfail.h"
+#include "exit.h"
 
 int volatile exit_failure = EXIT_FAILURE;
Index: lib/fatal.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/fatal.c,v
retrieving revision 1.5
diff -p -u -r1.5 fatal.c
--- lib/fatal.c 9 Sep 2003 06:37:10 -0000       1.5
+++ lib/fatal.c 12 Sep 2003 20:05:24 -0000
@@ -20,10 +20,9 @@
 # include <config.h>
 #endif
 
-/* FIXME: define EXIT_FAILURE */
-
 #include "fatal.h"
 
+#include "exit.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: lib/obstack.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/obstack.c,v
retrieving revision 1.20
diff -p -u -r1.20 obstack.c
--- lib/obstack.c       9 Sep 2003 23:00:43 -0000       1.20
+++ lib/obstack.c       12 Sep 2003 20:05:25 -0000
@@ -82,8 +82,8 @@ void (*obstack_alloc_failed_handler) (vo
 
 /* Exit value used when `print_and_abort' is used.  */
 # include <stdlib.h>
-# ifndef EXIT_FAILURE
-#  define EXIT_FAILURE 1
+# ifndef _LIBC
+#  include "exit.h"
 # endif
 int obstack_exit_failure = EXIT_FAILURE;
 
Index: lib/xgethostname.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xgethostname.c,v
retrieving revision 1.15
diff -p -u -r1.15 xgethostname.c
--- lib/xgethostname.c  12 Sep 2003 18:24:51 -0000      1.15
+++ lib/xgethostname.c  12 Sep 2003 20:05:25 -0000
@@ -30,14 +30,11 @@ extern int errno;
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "xalloc.h"
 
 #ifndef ENAMETOOLONG
 # define ENAMETOOLONG 9999
-#endif
-
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
 #endif
 
 int gethostname ();
Index: lib/xmalloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xmalloc.c,v
retrieving revision 1.26
diff -p -u -r1.26 xmalloc.c
--- lib/xmalloc.c       12 Sep 2003 18:24:51 -0000      1.26
+++ lib/xmalloc.c       12 Sep 2003 20:05:25 -0000
@@ -30,11 +30,8 @@
 #define N_(msgid) msgid
 
 #include "error.h"
+#include "exit.h"
 #include "exitfail.h"
-
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
 
 /* The following tests require AC_PREREQ(2.54).  */
 
Index: modules/argmatch
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/argmatch,v
retrieving revision 1.3
diff -p -u -r1.3 argmatch
--- modules/argmatch    20 Jan 2003 10:02:37 -0000      1.3
+++ modules/argmatch    12 Sep 2003 20:05:25 -0000
@@ -6,10 +6,11 @@ lib/argmatch.h
 lib/argmatch.c
 
 Depends-on:
-gettext
 error
-quotearg
+exit
+gettext
 quote
+quotearg
 unlocked-io
 
 configure.ac:
Index: modules/exitfail
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/exitfail,v
retrieving revision 1.3
diff -p -u -r1.3 exitfail
--- modules/exitfail    20 Jan 2003 10:02:37 -0000      1.3
+++ modules/exitfail    12 Sep 2003 20:05:25 -0000
@@ -7,6 +7,7 @@ lib/exitfail.c
 m4/exitfail.m4
 
 Depends-on:
+exit
 
 configure.ac:
 gl_EXITFAIL
Index: modules/obstack
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/obstack,v
retrieving revision 1.3
diff -p -u -r1.3 obstack
--- modules/obstack     20 Jan 2003 10:02:38 -0000      1.3
+++ modules/obstack     12 Sep 2003 20:05:25 -0000
@@ -7,6 +7,7 @@ lib/obstack.c
 m4/obstack.m4
 
 Depends-on:
+exit
 gettext
 
 configure.ac:
Index: modules/xgethostname
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/xgethostname,v
retrieving revision 1.3
diff -p -u -r1.3 xgethostname
--- modules/xgethostname        20 Jan 2003 10:02:38 -0000      1.3
+++ modules/xgethostname        12 Sep 2003 20:05:25 -0000
@@ -5,9 +5,10 @@ Files:
 lib/xgethostname.c
 
 Depends-on:
+error
+exit
 gethostname
 xalloc
-error
 
 configure.ac:
 
Index: modules/xalloc
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/xalloc,v
retrieving revision 1.4
diff -p -u -r1.4 xalloc
--- modules/xalloc      22 Jul 2003 22:10:56 -0000      1.4
+++ modules/xalloc      12 Sep 2003 20:05:25 -0000
@@ -8,11 +8,12 @@ lib/xstrdup.c
 m4/xalloc.m4
 
 Depends-on:
-malloc
-realloc
 error
-gettext
+exit
 exitfail
+gettext
+malloc
+realloc
 
 configure.ac:
 gl_XALLOC




reply via email to

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