From f7fcda6c4cc65aede241b72bc0674dd9ea93fada Mon Sep 17 00:00:00 2001 From: brarcher Date: Sun, 4 Nov 2012 03:13:44 +0000 Subject: [PATCH] Change definition of unsetenv to follow POSIX.1-2001 Prior to glibc 2.2.2, unsetenv() was prototyped as returning void, as was this version. However, check's unit tests expect unsetenv to return an integer. On systems where the override version of unsetenv is used, check would not compile. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@643 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- lib/libcompat.h | 2 +- lib/unsetenv.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libcompat.h b/lib/libcompat.h index e0085c6..52b84e4 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -99,7 +99,7 @@ const char *strsignal (int sig); #endif /* !HAVE_DECL_STRSIGNAL */ #if !HAVE_DECL_UNSETENV -void unsetenv (const char *name); +int unsetenv (const char *name); #endif /* !HAVE_DECL_UNSETENV */ /* silence warnings about an empty library */ diff --git a/lib/unsetenv.c b/lib/unsetenv.c index af068c2..4abad73 100644 --- a/lib/unsetenv.c +++ b/lib/unsetenv.c @@ -1,7 +1,8 @@ #include "libcompat.h" -void +int unsetenv (const char *name CK_ATTRIBUTE_UNUSED) { assert (0); + return 0; } -- 2.40.0