]> Savannah Git Hosting - gnulib.git/commitdiff
Fix xalloc-die like openat-die
authorBruce Korb <bkorb@gnu.org>
Fri, 31 Dec 2010 02:27:00 +0000 (18:27 -0800)
committerBruce Korb <bkorb@gnu.org>
Fri, 31 Dec 2010 02:27:00 +0000 (18:27 -0800)
ChangeLog
lib/openat-die.c
lib/xalloc-die.c

index 89fddfb6ad118319bd62b31169d1013a099cbe0d..b393086f8497dc59a9775e62a139bd411f3cab92 100644 (file)
--- 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>
index ad2476ffba417156ff224c0987d9c538ec3be052..d4d14ec003fb1ca19dc49230f2f0f383af5f46c8 100644 (file)
@@ -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 ();
index 4b220403b062571131f279491f4bb522e0d2766d..16adcd459665f58147b63f686a9306eff94b663c 100644 (file)
 
 #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