summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-26 12:41:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-26 12:41:43 +0000
commit96542c36786fb4dd6a94d0b83834f267478f2241 (patch)
tree0c074c4e45b13cba3636a26b4a1eb6cdc3f2f35c /hash.c
parentfe98a03c532936b80199e84fc5d94bbe295bdaf0 (diff)
* configure.in: test unsetenv returns a value.
unsetenv is void in older BSDs (FreeBSD 6 and OpenBSD 4.5 at least). * hash.c (ruby_setenv): don't use the result of unsetenv if unsetenv doesn't return a value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 124df01385..7a6bfe8134 100644
--- a/hash.c
+++ b/hash.c
@@ -2073,8 +2073,12 @@ ruby_setenv(const char *name, const char *value)
if (setenv(name, value, 1))
rb_sys_fail("setenv");
} else {
+#ifdef VOID_UNSETENV
+ unsetenv(name);
+#else
if (unsetenv(name))
rb_sys_fail("unsetenv");
+#endif
}
#elif defined __sun__
size_t len;