From: Bruce Korb Date: Fri, 31 Dec 2010 02:27:00 +0000 (-0800) Subject: Fix xalloc-die like openat-die X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0b8a21c233dd29e3ab32b7a574e71477bccff4cb;p=gnulib.git Fix xalloc-die like openat-die --- diff --git a/ChangeLog b/ChangeLog index 89fddfb6ad..b393086f84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ config.h so that openat-die.c can omit calls to error(). * lib/openat-die.c: remove error module stuff when GNULIB_LIBPOSIX is defined. + * lib/xalloc-die.c: Same thing. * libposix/lib/mk-lpx-config-h.sh (GNULIB_TEST): remove these defines 2010-12-29 Eric Blake diff --git a/lib/openat-die.c b/lib/openat-die.c index ad2476ffba..d4d14ec003 100644 --- a/lib/openat-die.c +++ b/lib/openat-die.c @@ -23,7 +23,7 @@ #ifndef GNULIB_LIBPOSIX #include "error.h" -#endif GNULIB_LIBPOSIX +#endif /* GNULIB_LIBPOSIX */ #include "exitfail.h" #include "gettext.h" @@ -35,7 +35,7 @@ openat_save_fail (int errnum) #ifndef GNULIB_LIBPOSIX error (exit_failure, errnum, _("unable to record current working directory")); -#endif GNULIB_LIBPOSIX +#endif /* GNULIB_LIBPOSIX */ /* The `noreturn' attribute cannot be applied to error, since it returns when its first argument is 0. To help compilers understand that this function does not return, call abort. Also, the abort is a @@ -54,7 +54,7 @@ openat_restore_fail (int errnum) #ifndef GNULIB_LIBPOSIX error (exit_failure, errnum, _("failed to return to initial working directory")); -#endif GNULIB_LIBPOSIX +#endif /* GNULIB_LIBPOSIX */ /* As above. */ abort (); diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c index 4b220403b0..16adcd4596 100644 --- a/lib/xalloc-die.c +++ b/lib/xalloc-die.c @@ -22,7 +22,10 @@ #include +#ifndef GNULIB_LIBPOSIX #include "error.h" +#endif /* GNULIB_LIBPOSIX */ + #include "exitfail.h" #include "gettext.h" @@ -31,7 +34,9 @@ void xalloc_die (void) { +#ifndef GNULIB_LIBPOSIX error (exit_failure, 0, "%s", _("memory exhausted")); +#endif /* GNULIB_LIBPOSIX */ /* The `noreturn' cannot be given to error, since it may return if its first argument is 0. To help compilers understand the