bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xalloc removal of dependency on error, exitfail, etc.


From: Paul Eggert
Subject: xalloc removal of dependency on error, exitfail, etc.
Date: Mon, 09 Aug 2004 11:49:59 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Here are the changes I installed into coreutils that were needed
after I imported the latest gnulib, with the xalloc dependency cleanup.

2004-08-09  Paul Eggert  <address@hidden>

        * lib/Makefile.am (libfetish_a_SOURCES): Add xalloc-die.c.
        * src/csplit.c (xalloc_die): New function.
        (main): Remove now-obsolete initialization of xalloc_fail_func.

Index: lib/Makefile.am
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/Makefile.am,v
retrieving revision 1.192
diff -p -u -r1.192 Makefile.am
--- lib/Makefile.am     2 Aug 2004 20:14:53 -0000       1.192
+++ lib/Makefile.am     9 Aug 2004 07:26:29 -0000
@@ -122,6 +122,7 @@ libfetish_a_SOURCES = \
   utimens.c utimens.h \
   version-etc.c version-etc.h \
   xalloc.h \
+  xalloc-die.c \
   xfts.c xfts.h \
   xgetcwd.c xgetcwd.h \
   xgethostname.c xgethostname.h \
Index: src/csplit.c
===================================================================
RCS file: /home/eggert/coreutils/cu/src/csplit.c,v
retrieving revision 1.129
diff -p -u -r1.129 csplit.c
--- src/csplit.c        3 Aug 2004 05:58:49 -0000       1.129
+++ src/csplit.c        9 Aug 2004 06:54:08 -0000
@@ -227,6 +227,13 @@ cleanup_fatal (void)
   exit (EXIT_FAILURE);
 }
 
+void
+xalloc_die (void)
+{
+  error (0, 0, "%s", _("memory exhausted"));
+  cleanup_fatal ();
+}
+
 static void
 interrupt_handler (int sig)
 {
@@ -1327,9 +1334,6 @@ main (int argc, char **argv)
   suppress_count = false;
   remove_files = true;
   prefix = DEFAULT_PREFIX;
-
-  /* Change the way xmalloc and xrealloc fail.  */
-  xalloc_fail_func = cleanup;
 
   while ((optc = getopt_long (argc, argv, "f:b:kn:sqz", longopts, NULL)) != -1)
     switch (optc)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]