From 96542c36786fb4dd6a94d0b83834f267478f2241 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 26 Jan 2010 12:41:43 +0000 Subject: * 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 --- hash.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hash.c') 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; -- cgit v1.2.3