Browse Source

Fix compiler warnings.

v0.7.4-release
Ben Noordhuis 14 years ago
committed by Ryan Dahl
parent
commit
80b5a52217
  1. 6
      src/node_child_process.cc
  2. 8
      src/node_stdio.cc

6
src/node_child_process.cc

@ -226,9 +226,9 @@ int ChildProcess::Spawn(const char *file,
int stdin_pipe[2], stdout_pipe[2], stderr_pipe[2];
/* An implementation of popen(), basically */
if (custom_fds[0] == -1 && pipe(stdin_pipe) < 0 ||
custom_fds[1] == -1 && pipe(stdout_pipe) < 0 ||
custom_fds[2] == -1 && pipe(stderr_pipe) < 0) {
if ((custom_fds[0] == -1 && pipe(stdin_pipe) < 0) ||
(custom_fds[1] == -1 && pipe(stdout_pipe) < 0) ||
(custom_fds[2] == -1 && pipe(stderr_pipe) < 0)) {
perror("pipe()");
return -1;
}

8
src/node_stdio.cc

@ -129,7 +129,7 @@ WriteError (const Arguments& args)
ssize_t r;
size_t written = 0;
while (written < msg.length()) {
while (written < (size_t) msg.length()) {
r = write(STDERR_FILENO, (*msg) + written, msg.length() - written);
if (r < 0) {
if (errno == EAGAIN || errno == EIO) {
@ -217,7 +217,7 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
// XXX selecting on tty fds wont work in windows.
// Must ALWAYS make a coupling on shitty platforms.
stdout_flags = fcntl(STDOUT_FILENO, F_GETFL, 0);
int r = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags | O_NONBLOCK);
fcntl(STDOUT_FILENO, F_SETFL, stdout_flags | O_NONBLOCK);
}
target->Set(String::NewSymbol("stdoutFD"), Integer::New(STDOUT_FILENO));
@ -233,8 +233,10 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
NODE_SET_METHOD(target, "getRows", GetRows);
NODE_SET_METHOD(target, "isatty", IsATTY);
struct sigaction sa = {0};
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = HandleSIGCONT;
sa.sa_restorer = NULL;
sigaction(SIGCONT, &sa, NULL);
}

Loading…
Cancel
Save