]> granicus.if.org Git - check/commitdiff
Change definition of unsetenv to follow POSIX.1-2001
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 4 Nov 2012 03:13:44 +0000 (03:13 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 4 Nov 2012 03:13:44 +0000 (03:13 +0000)
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
lib/unsetenv.c

index e0085c66fbbd54a3dea24174d0a200a7bc8cb313..52b84e4cac7f147a1792c349c391b46f1f5aa1c3 100644 (file)
@@ -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 */
index af068c2e0c7cda895adf07a4640930d9759a50bd..4abad730e75d2e4cd2cba5a4362bb2b304482566 100644 (file)
@@ -1,7 +1,8 @@
 #include "libcompat.h"
 
-void
+int
 unsetenv (const char *name CK_ATTRIBUTE_UNUSED)
 {
   assert (0);
+  return 0;
 }