Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
diff --git a/src/node.cc b/src/node.cc
index f6ae19d..04ff7d1 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -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.