uv_fs_event_t uvhandle_sockpath;
int r;
- if (fcntl(0, F_SETFL, O_NONBLOCK)) diee("watcher set stdin nonblocking");
+ nonblock(0);
errno= -uv_loop_init(&loop);
if (errno) diee("watcher: uv_loop_init");
if (dup2(null_0, 0)) diee("dup2 /dev/null onto stdin");
if (dup2(2, 1) != 1) die("dup2 stderr onto stdout");
+ nonblock(sfd);
+
// Extension could work like this:
//
// We advertise a new protocol (perhaps one which is nearly entirely
close(watcher_stdin[0]);
close(watcher_stderr[1]);
- if (fcntl(watcher_stderr[0], F_SETFL, O_NONBLOCK))
- diee("parent set watcher stderr nonblocking");
+ nonblock(watcher_stderr[0]);
// Fork setup