Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created February 15, 2012 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/21a5bca23f3a9f9aa999 to your computer and use it in GitHub Desktop.
Save bnoordhuis/21a5bca23f3a9f9aa999 to your computer and use it in GitHub Desktop.
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