Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis bnoordhuis/setenv.patch Secret
Created Feb 15, 2012

What would you like to do?
diff --git a/src/ b/src/
index f6ae19d..04ff7d1 100644
--- a/src/
+++ b/src/
@@ -1887,7 +1887,7 @@ static Handle<Value> EnvSetter(Local<String> property,
String::Utf8Value val(value);
#ifdef __POSIX__
- setenv(*key, *val, 1);
+ if (setenv(*key, *val, 1)) return Undefined();
#else // __WIN32__
int n = key.length() + val.length() + 2;
char* pair = new char[n];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.