Fix a bug that was suppressing the error in setgid, allowing it to fail silently.

This commit is contained in:
isaacs
2010-03-03 01:11:47 -08:00
committed by Ryan Dahl
parent 769a35024f
commit 0dba38eef0

View File

@@ -506,7 +506,7 @@ static Handle<Value> SetGid(const Arguments& args) {
Local<Integer> given_gid = args[0]->ToInteger();
int gid = given_gid->Int32Value();
int result;
if ((result == setgid(gid)) != 0) {
if ((result = setgid(gid)) != 0) {
return ThrowException(Exception::Error(String::New(strerror(errno))));
}
return Undefined();