Browse Source

typo setuid -> setsid

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
63bd237892
  1. 8
      lib/child_process.js
  2. 12
      src/node_child_process.cc
  3. 2
      src/node_child_process.h

8
lib/child_process.js

@ -185,7 +185,7 @@ ChildProcess.prototype.kill = function(sig) {
ChildProcess.prototype.spawn = function(path, args, options, customFds) {
args = args || [];
var cwd, env, setuid;
var cwd, env, setsid;
if (!options || options.cwd === undefined &&
options.env === undefined &&
options.customFds === undefined) {
@ -193,13 +193,13 @@ ChildProcess.prototype.spawn = function(path, args, options, customFds) {
cwd = '';
env = options || process.env;
customFds = customFds || [-1, -1, -1];
setuid = false;
setsid = false;
} else {
// Recommended API: (path, args, options)
cwd = options.cwd || '';
env = options.env || process.env;
customFds = options.customFds || [-1, -1, -1];
setuid = options.setuid ? true : false;
setsid = options.setsid ? true : false;
}
var envPairs = [];
@ -214,7 +214,7 @@ ChildProcess.prototype.spawn = function(path, args, options, customFds) {
cwd,
envPairs,
customFds,
setuid);
setsid);
this.fds = fds;
if (customFds[0] === -1 || customFds[0] === undefined) {

12
src/node_child_process.cc

@ -150,15 +150,15 @@ Handle<Value> ChildProcess::Spawn(const Arguments& args) {
}
}
int do_setuid = false;
int do_setsid = false;
if (args[5]->IsBoolean()) {
do_setuid = args[5]->BooleanValue();
do_setsid = args[5]->BooleanValue();
}
int fds[3];
int r = child->Spawn(argv[0], argv, cwd, env, fds, custom_fds, do_setuid);
int r = child->Spawn(argv[0], argv, cwd, env, fds, custom_fds, do_setsid);
for (i = 0; i < argv_length; i++) free(argv[i]);
delete [] argv;
@ -233,7 +233,7 @@ int ChildProcess::Spawn(const char *file,
char **env,
int stdio_fds[3],
int custom_fds[3],
bool do_setuid) {
bool do_setsid) {
HandleScope scope;
assert(pid_ == -1);
assert(!ev_is_active(&child_watcher_));
@ -274,8 +274,8 @@ int ChildProcess::Spawn(const char *file,
return -4;
case 0: // Child.
if (do_setuid && setsid() < 0) {
perror("setuid");
if (do_setsid && setsid() < 0) {
perror("setsid");
}
if (custom_fds[0] == -1) {

2
src/node_child_process.h

@ -64,7 +64,7 @@ class ChildProcess : ObjectWrap {
char **env,
int stdio_fds[3],
int custom_fds[3],
bool do_setuid);
bool do_setsid);
// Simple syscall wrapper. Does not disable the watcher. onexit will be
// called still.

Loading…
Cancel
Save