From: Philip Homburg Date: Mon, 23 Apr 2007 14:43:25 +0000 (+0000) Subject: Initialize exec_pipe. X-Git-Tag: v3.1.4~405 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.png?a=commitdiff_plain;h=727ce18aa8bb34dbe1e54c7939f830b39db9bd62;p=minix.git Initialize exec_pipe. --- diff --git a/servers/rs/main.c b/servers/rs/main.c index d7a663cf8..a1135882d 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -8,6 +8,7 @@ * Jul 22, 2005 by Jorrit N. Herder */ #include "inc.h" +#include #include #include #include "../../kernel/const.h" @@ -160,6 +161,25 @@ PRIVATE void init_server(void) /* See if we run in verbose mode. */ env_parse("rs_verbose", "d", 0, &rs_verbose, 0, 1); + + /* Initialize the exec pipe. */ + if (pipe(exec_pipe) == -1) + panic("RS", "pipe failed", errno); + if (fcntl(exec_pipe[0], F_SETFD, + fcntl(exec_pipe[0], F_GETFD) | FD_CLOEXEC) == -1) + { + panic("RS", "fcntl set FD_CLOEXEC on pipe input failed", errno); + } + if (fcntl(exec_pipe[1], F_SETFD, + fcntl(exec_pipe[1], F_GETFD) | FD_CLOEXEC) == -1) + { + panic("RS", "fcntl set FD_CLOEXEC on pipe output failed", errno); + } + if (fcntl(exec_pipe[0], F_SETFL, + fcntl(exec_pipe[0], F_GETFL) | O_NONBLOCK) == -1) + { + panic("RS", "fcntl set O_NONBLOCK on pipe input failed", errno); + } } /*===========================================================================*