From b4e93f8d11e7fd37a392eec00b57135d6f6b0d4f Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Fri, 12 Sep 2003 14:30:29 +0000 Subject: [PATCH] port to FreeBSD --- inetutils/inetutils.patch | 66 +++++++++++++++++++++++++++++++++++++++ inetutils/inetutils.spec | 4 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 inetutils/inetutils.patch diff --git a/inetutils/inetutils.patch b/inetutils/inetutils.patch new file mode 100644 index 0000000000..f29a62a31d --- /dev/null +++ b/inetutils/inetutils.patch @@ -0,0 +1,66 @@ +--- 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 ++# include + #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 diff --git a/inetutils/inetutils.spec b/inetutils/inetutils.spec index 0d36a281d2..922d2926dd 100644 --- a/inetutils/inetutils.spec +++ b/inetutils/inetutils.spec @@ -33,7 +33,7 @@ Distribution: OpenPKG [EVAL] Group: Network License: GPL Version: 1.4.2 -Release: 20030821 +Release: 20030912 # package options %option with_fsl yes @@ -41,6 +41,7 @@ Release: 20030821 # list of sources Source0: ftp://ftp.gnu.org/gnu/inetutils/inetutils-%{version}.tar.gz +Patch0: inetutils.patch # build information Prefix: %{l_prefix} @@ -63,6 +64,7 @@ AutoReqProv: no %prep %setup -q + %patch -p0 %build CC="%{l_cc}" \