From 0a7cea64efef430e2bbf6329bd56ed49405ba25b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 10:40:11 +0100 Subject: [PATCH] - fixed a oom check - attempt to get sol10/x86 to build --- configure.in | 8 ++++++++ util.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3229ef0b7..321c592fc 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,14 @@ AC_PROG_INSTALL AC_DEFINE([_GNU_SOURCE], 1, [Define _GNU_SOURCE so that we get all necessary prototypes]) +# The definition of _GNU_SOURCE potentially causes a change of the value +# of _XOPEN_SOURCE. So define it only conditionally. +AH_VERBATIM([_XOPEN_SOURCE], +[/* Define on UNIX to activate XPG/5 features. */ +#if !defined(_XOPEN_SOURCE) +# define _XOPEN_SOURCE 500 +#endif]) + # If GCC, turn on warnings. if test "x$GCC" = "xyes" then diff --git a/util.c b/util.c index ec5ccdd49..40efa8329 100644 --- a/util.c +++ b/util.c @@ -151,7 +151,7 @@ void x_asprintf(char **ptr, const char *format, ...) vasprintf(ptr, format, ap); va_end(ap); - if (!ptr) fatal("out of memory in x_asprintf"); + if (!*ptr) fatal("out of memory in x_asprintf"); } /* -- 2.47.2