From 0dba38eef0f026df3f232a4f5cf1cbbcaa57fc1b Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 3 Mar 2010 01:11:47 -0800 Subject: [PATCH] Fix a bug that was suppressing the error in setgid, allowing it to fail silently. --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index d760c7297..11c6a7de8 100644 --- a/src/node.cc +++ b/src/node.cc @@ -506,7 +506,7 @@ static Handle SetGid(const Arguments& args) { Local 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();