|
|
@ -1330,38 +1330,6 @@ Local<Value> ExecuteString(Handle<String> source, Handle<Value> filename) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* STDERR IS ALWAY SYNC ALWAYS UTF8 */ |
|
|
|
static Handle<Value> WriteError (const Arguments& args) { |
|
|
|
HandleScope scope; |
|
|
|
|
|
|
|
if (args.Length() < 1) { |
|
|
|
return Undefined(); |
|
|
|
} |
|
|
|
|
|
|
|
String::Utf8Value msg(args[0]->ToString()); |
|
|
|
|
|
|
|
ssize_t r; |
|
|
|
size_t written = 0; |
|
|
|
while (written < (size_t) msg.length()) { |
|
|
|
r = write(STDERR_FILENO, (*msg) + written, msg.length() - written); |
|
|
|
if (r < 0) { |
|
|
|
if (errno == EAGAIN || errno == EIO) { |
|
|
|
#ifdef __POSIX__ |
|
|
|
usleep(100); |
|
|
|
#else |
|
|
|
Sleep(100); |
|
|
|
#endif |
|
|
|
continue; |
|
|
|
} |
|
|
|
return ThrowException(ErrnoException(errno, "write")); |
|
|
|
} |
|
|
|
written += (size_t)r; |
|
|
|
} |
|
|
|
|
|
|
|
return True(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Handle<Value> Chdir(const Arguments& args) { |
|
|
|
HandleScope scope; |
|
|
|
|
|
|
@ -2174,8 +2142,6 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) { |
|
|
|
NODE_SET_METHOD(process, "chdir", Chdir); |
|
|
|
NODE_SET_METHOD(process, "cwd", Cwd); |
|
|
|
|
|
|
|
NODE_SET_METHOD(process, "writeError", WriteError); |
|
|
|
|
|
|
|
NODE_SET_METHOD(process, "umask", Umask); |
|
|
|
|
|
|
|
#ifdef __POSIX__ |
|
|
|