Permalink
Browse files

Fix #2405 spawn on windows

  • Loading branch information...
1 parent c7327c6 commit bbe8a9d3630df62853324f78053fe8c2f99a6f27 @isaacs isaacs committed May 2, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/utils/exec.js
View
@@ -36,7 +36,7 @@ function exec (cmd, args, env, takeOver, cwd, uid, gid, cb) {
log.verbose(new Error().stack, "stack at uid setting")
}
- if (isNaN(uid) || isNaN(gid)) {
+ if (uid && gid && (isNaN(uid) || isNaN(gid))) {
// get the numeric values
return uidNumber(uid, gid, function (er, uid, gid) {
if (er) return cb(er)
@@ -106,12 +106,8 @@ function spawn (c, a, env, takeOver, cwd, uid, gid) {
, cwd : cwd || null }
, cp
- if (!isNaN(uid)) opts.uid = uid
- if (!isNaN(gid)) opts.gid = gid
-
- if (!isNaN(opts.uid)) opts.uid = +opts.uid
-
- if (!isNaN(opts.gid)) opts.gid = +opts.gid
+ if (!isNaN(uid)) opts.uid = +uid
+ if (!isNaN(gid)) opts.gid = +gid
var name = c +" "+ a.map(JSON.stringify).join(" ")
log.silly([c, a, opts.cwd], "spawning")

0 comments on commit bbe8a9d

Please sign in to comment.