changeset 14124:ff9ca89936a2

Fix xalloc-die like openat-die
author Bruce Korb <bkorb@gnu.org>
date Thu, 30 Dec 2010 18:27:00 -0800
parents 514ae5562fd2
children b1cfb22df170
files ChangeLog lib/openat-die.c lib/xalloc-die.c
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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  <eblake@redhat.com>
--- 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 @@
 #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 @@
 #ifndef GNULIB_LIBPOSIX
   error (exit_failure, errnum,
          _("failed to return to initial working directory"));
-#endif  GNULIB_LIBPOSIX
+#endif  /* GNULIB_LIBPOSIX */
 
   /* As above.  */
   abort ();
--- a/lib/xalloc-die.c
+++ b/lib/xalloc-die.c
@@ -22,7 +22,10 @@
 
 #include <stdlib.h>
 
+#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