]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
lib/getdate: Tweak xalloc-die to avoid more gnulib dependencies.
authorCarl Worth <cworth@cworth.org>
Thu, 11 Mar 2010 00:18:59 +0000 (16:18 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 11 Mar 2010 00:18:59 +0000 (16:18 -0800)
This tiny function originally wanted additional gnulib headers, but
that seems crazy. So instead, we'll maintain this function locally and
not import it from gnulib in the future.

lib/getdate/import
lib/getdate/xalloc-die.c

index e3a789c3e4c649bfa6b62aa019ba36ac6c71ead6..f15d101755cd4bafa07970ef75a426cf1d546b3d 100755 (executable)
@@ -25,7 +25,6 @@ files="c-ctype.c
        timespec.h
        verify.h
        xalloc.h
-       xalloc-die.c
        xmalloc.c"
 
 for file in $files; do
index 4b220403b062571131f279491f4bb522e0d2766d..a7a9cbc0b297cf5d54bf9ed239b4b0c03091708d 100644 (file)
 
 #include "xalloc.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#include "error.h"
-#include "exitfail.h"
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
 
 void
 xalloc_die (void)
 {
-  error (exit_failure, 0, "%s", _("memory exhausted"));
-
-  /* The `noreturn' cannot be given to error, since it may return if
-     its first argument is 0.  To help compilers understand the
-     xalloc_die does not return, call abort.  Also, the abort is a
-     safety feature if exit_failure is 0 (which shouldn't happen).  */
-  abort ();
+  fprintf (stderr, "memory exhausted\n");
+  exit (1);
 }