|
@ -734,8 +734,7 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) { |
|
|
} |
|
|
} |
|
|
Local<Value> js_uid = js_options->Get(env()->uid_string()); |
|
|
Local<Value> js_uid = js_options->Get(env()->uid_string()); |
|
|
if (IsSet(js_uid)) { |
|
|
if (IsSet(js_uid)) { |
|
|
if (!js_uid->IsInt32()) |
|
|
CHECK(js_uid->IsInt32()); |
|
|
return UV_EINVAL; |
|
|
|
|
|
const int32_t uid = js_uid->Int32Value(env()->context()).FromJust(); |
|
|
const int32_t uid = js_uid->Int32Value(env()->context()).FromJust(); |
|
|
uv_process_options_.uid = static_cast<uv_uid_t>(uid); |
|
|
uv_process_options_.uid = static_cast<uv_uid_t>(uid); |
|
|
uv_process_options_.flags |= UV_PROCESS_SETUID; |
|
|
uv_process_options_.flags |= UV_PROCESS_SETUID; |
|
@ -743,8 +742,7 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) { |
|
|
|
|
|
|
|
|
Local<Value> js_gid = js_options->Get(env()->gid_string()); |
|
|
Local<Value> js_gid = js_options->Get(env()->gid_string()); |
|
|
if (IsSet(js_gid)) { |
|
|
if (IsSet(js_gid)) { |
|
|
if (!js_gid->IsInt32()) |
|
|
CHECK(js_gid->IsInt32()); |
|
|
return UV_EINVAL; |
|
|
|
|
|
const int32_t gid = js_gid->Int32Value(env()->context()).FromJust(); |
|
|
const int32_t gid = js_gid->Int32Value(env()->context()).FromJust(); |
|
|
uv_process_options_.gid = static_cast<uv_gid_t>(gid); |
|
|
uv_process_options_.gid = static_cast<uv_gid_t>(gid); |
|
|
uv_process_options_.flags |= UV_PROCESS_SETGID; |
|
|
uv_process_options_.flags |= UV_PROCESS_SETGID; |
|
@ -760,28 +758,21 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) { |
|
|
|
|
|
|
|
|
Local<Value> js_timeout = js_options->Get(env()->timeout_string()); |
|
|
Local<Value> js_timeout = js_options->Get(env()->timeout_string()); |
|
|
if (IsSet(js_timeout)) { |
|
|
if (IsSet(js_timeout)) { |
|
|
if (!js_timeout->IsNumber()) |
|
|
CHECK(js_timeout->IsNumber()); |
|
|
return UV_EINVAL; |
|
|
|
|
|
int64_t timeout = js_timeout->IntegerValue(); |
|
|
int64_t timeout = js_timeout->IntegerValue(); |
|
|
if (timeout < 0) |
|
|
|
|
|
return UV_EINVAL; |
|
|
|
|
|
timeout_ = static_cast<uint64_t>(timeout); |
|
|
timeout_ = static_cast<uint64_t>(timeout); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Local<Value> js_max_buffer = js_options->Get(env()->max_buffer_string()); |
|
|
Local<Value> js_max_buffer = js_options->Get(env()->max_buffer_string()); |
|
|
if (IsSet(js_max_buffer)) { |
|
|
if (IsSet(js_max_buffer)) { |
|
|
if (!js_max_buffer->IsUint32()) |
|
|
CHECK(js_max_buffer->IsUint32()); |
|
|
return UV_EINVAL; |
|
|
|
|
|
max_buffer_ = js_max_buffer->Uint32Value(); |
|
|
max_buffer_ = js_max_buffer->Uint32Value(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Local<Value> js_kill_signal = js_options->Get(env()->kill_signal_string()); |
|
|
Local<Value> js_kill_signal = js_options->Get(env()->kill_signal_string()); |
|
|
if (IsSet(js_kill_signal)) { |
|
|
if (IsSet(js_kill_signal)) { |
|
|
if (!js_kill_signal->IsInt32()) |
|
|
CHECK(js_kill_signal->IsInt32()); |
|
|
return UV_EINVAL; |
|
|
|
|
|
kill_signal_ = js_kill_signal->Int32Value(); |
|
|
kill_signal_ = js_kill_signal->Int32Value(); |
|
|
if (kill_signal_ == 0) |
|
|
|
|
|
return UV_EINVAL; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Local<Value> js_stdio = js_options->Get(env()->stdio_string()); |
|
|
Local<Value> js_stdio = js_options->Get(env()->stdio_string()); |
|
|