diff --git a/src/node.cc b/src/node.cc index 309fc96383..7026cec773 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1508,6 +1508,7 @@ static Handle SetGid(const Arguments& args) { struct group grp, *grpp = NULL; int err; + errno = 0; if ((err = getgrnam_r(*grpnam, &grp, getbuf, ARRAY_SIZE(getbuf), &grpp)) || grpp == NULL) { if (errno == 0) @@ -1548,6 +1549,7 @@ static Handle SetUid(const Arguments& args) { struct passwd pwd, *pwdp = NULL; int err; + errno = 0; if ((err = getpwnam_r(*pwnam, &pwd, getbuf, ARRAY_SIZE(getbuf), &pwdp)) || pwdp == NULL) { if (errno == 0)