You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.9 KiB
66 lines
1.9 KiB
--- libinetutils/xalloc.h.orig 2002-12-11 13:51:10.000000000 +0100 |
|
+++ libinetutils/xalloc.h 2003-09-12 16:25:19.000000000 +0200 |
|
@@ -39,7 +39,9 @@ |
|
/* Exit value when the requested amount of memory is not available. |
|
It is initialized to EXIT_FAILURE, but the caller may set it to |
|
some other value. */ |
|
+#ifdef __GLIBC__ |
|
extern int xalloc_exit_failure; |
|
+#endif |
|
|
|
/* If this pointer is non-zero, run the specified function upon each |
|
allocation failure. It is initialized to zero. */ |
|
--- libinetutils/xmalloc.c.orig 2002-12-11 13:42:01.000000000 +0100 |
|
+++ libinetutils/xmalloc.c 2003-09-12 16:25:51.000000000 +0200 |
|
@@ -23,6 +23,7 @@ |
|
|
|
#if STDC_HEADERS |
|
# include <stdlib.h> |
|
+# include <stdio.h> |
|
#else |
|
void *calloc (); |
|
void *malloc (); |
|
@@ -34,7 +35,9 @@ |
|
#define _(msgid) gettext (msgid) |
|
#define N_(msgid) msgid |
|
|
|
+#ifdef __GLIBC__ |
|
#include "error.h" |
|
+#endif |
|
#include "xalloc.h" |
|
|
|
#ifndef EXIT_FAILURE |
|
@@ -53,7 +56,9 @@ |
|
|
|
/* Exit value when the requested amount of memory is not available. |
|
The caller may set it to some other value. */ |
|
+#ifdef __GLIBC__ |
|
int xalloc_exit_failure = EXIT_FAILURE; |
|
+#endif |
|
|
|
/* If non NULL, call this function when memory is exhausted. */ |
|
void (*xalloc_fail_func) PARAMS ((void)) = 0; |
|
@@ -67,7 +72,11 @@ |
|
{ |
|
if (xalloc_fail_func) |
|
(*xalloc_fail_func) (); |
|
+#ifdef __GLIBC__ |
|
error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); |
|
+#else |
|
+ fprintf(stderr, "%s", _(xalloc_msg_memory_exhausted)); |
|
+#endif |
|
/* 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 terminate, call exit. */ |
|
--- talk/io.c.orig 2001-06-02 17:27:15.000000000 +0200 |
|
+++ talk/io.c 2003-09-12 16:27:15.000000000 +0200 |
|
@@ -129,7 +129,9 @@ |
|
} |
|
|
|
extern int errno; |
|
+#if !defined(__FreeBSD__) |
|
extern int sys_nerr; |
|
+#endif |
|
|
|
/* |
|
* p_error prints the system error message on the standard location
|
|
|