From 1d31a1e7121fda63c28ca105309237f6fa98ab80 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 12 Sep 2003 20:14:10 +0000 Subject: [PATCH] Use "exit.h" rather than rolling EXIT_FAILURE ourselves in each module. --- lib/argmatch.c | 5 +---- lib/exitfail.c | 6 ++---- lib/fatal.c | 3 +-- lib/obstack.c | 4 ++-- lib/xgethostname.c | 5 +---- lib/xmalloc.c | 5 +---- modules/argmatch | 5 +++-- modules/exitfail | 1 + modules/obstack | 1 + modules/xalloc | 7 ++++--- modules/xgethostname | 3 ++- 11 files changed, 19 insertions(+), 26 deletions(-) diff --git a/lib/argmatch.c b/lib/argmatch.c index 345256af60..972a085e9b 100644 --- a/lib/argmatch.c +++ b/lib/argmatch.c @@ -35,6 +35,7 @@ #define _(msgid) gettext (msgid) #include "error.h" +#include "exit.h" #include "quotearg.h" #include "quote.h" #include "unlocked-io.h" @@ -46,10 +47,6 @@ # 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. */ #ifndef ARGMATCH_DIE # define ARGMATCH_DIE exit (EXIT_FAILURE) diff --git a/lib/exitfail.c b/lib/exitfail.c index 3668853bd8..2ae5f69555 100644 --- a/lib/exitfail.c +++ b/lib/exitfail.c @@ -21,9 +21,7 @@ # include #endif -#include -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif +#include "exitfail.h" +#include "exit.h" int volatile exit_failure = EXIT_FAILURE; diff --git a/lib/fatal.c b/lib/fatal.c index 8bcc3c5618..79e8a346e0 100644 --- a/lib/fatal.c +++ b/lib/fatal.c @@ -20,10 +20,9 @@ # include #endif -/* FIXME: define EXIT_FAILURE */ - #include "fatal.h" +#include "exit.h" #include #include #include diff --git a/lib/obstack.c b/lib/obstack.c index 705c65d4aa..bf6bba86c1 100644 --- a/lib/obstack.c +++ b/lib/obstack.c @@ -82,8 +82,8 @@ void (*obstack_alloc_failed_handler) (void) = print_and_abort; /* Exit value used when `print_and_abort' is used. */ # include -# ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 +# ifndef _LIBC +# include "exit.h" # endif int obstack_exit_failure = EXIT_FAILURE; diff --git a/lib/xgethostname.c b/lib/xgethostname.c index c0939945bb..494571ee1d 100644 --- a/lib/xgethostname.c +++ b/lib/xgethostname.c @@ -30,16 +30,13 @@ 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 (); #ifndef INITIAL_HOSTNAME_LENGTH diff --git a/lib/xmalloc.c b/lib/xmalloc.c index 82980ea58c..3adf5dda88 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -30,12 +30,9 @@ #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). */ #ifndef HAVE_MALLOC diff --git a/modules/argmatch b/modules/argmatch index 9f99899d54..8a1ed6d7ef 100644 --- a/modules/argmatch +++ b/modules/argmatch @@ -6,10 +6,11 @@ lib/argmatch.h lib/argmatch.c Depends-on: -gettext error -quotearg +exit +gettext quote +quotearg unlocked-io configure.ac: diff --git a/modules/exitfail b/modules/exitfail index 58367d5b67..67e82db311 100644 --- a/modules/exitfail +++ b/modules/exitfail @@ -7,6 +7,7 @@ lib/exitfail.c m4/exitfail.m4 Depends-on: +exit configure.ac: gl_EXITFAIL diff --git a/modules/obstack b/modules/obstack index 5937751ab4..acec7c112e 100644 --- a/modules/obstack +++ b/modules/obstack @@ -7,6 +7,7 @@ lib/obstack.c m4/obstack.m4 Depends-on: +exit gettext configure.ac: diff --git a/modules/xalloc b/modules/xalloc index 6c133a3c27..7e3321b348 100644 --- a/modules/xalloc +++ b/modules/xalloc @@ -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 diff --git a/modules/xgethostname b/modules/xgethostname index 659ae55ee6..ab08d898a7 100644 --- a/modules/xgethostname +++ b/modules/xgethostname @@ -5,9 +5,10 @@ Files: lib/xgethostname.c Depends-on: +error +exit gethostname xalloc -error configure.ac: -- 2.30.2