@@ -1,3 +1,9 @@
+2008-09-14 Guillem Jover <guillem@debian.org>
+
+ * libcompat/compat.h (unsetenv): Change return type from void to int.
+ * libcompat/unsetenv.c (unsetenv): Likewise. Return -1 on error, or
+ pass through the status code from putenv.
2008-09-14 Guillem Jover <guillem@debian.org>
* dselect/methkeys.cc: Remove unused headers <stdio.h>, <string.h>,
@@ -70,7 +70,7 @@ int alphasort(const struct dirent *a, const struct dirent *b);
#endif
#ifndef HAVE_UNSETENV
-void unsetenv(const char *x);
+int unsetenv(const char *x);
#ifdef __cplusplus
@@ -24,18 +24,18 @@
#include <string.h>
-void
+int
unsetenv(const char *p)
{
char *q;
q = malloc(strlen(p) + 3);
if (!q)
- return;
+ return -1;
strcpy(q, p);
strcat(q, "=");
- putenv(q);
+ return putenv(q);
}