Lines Matching refs:pipes
223 // pipes[2]: Filehandle to move to stdin/stdout of new process.
227 pid_t xpopen_both(char **argv, int *pipes)
231 // Make the pipes?
233 if (pipes) for (pid = 0; pid < 2; pid++) {
234 if (pipes[pid] != -1) continue;
241 if (pipes) {
248 pipes[1] = cestnepasun[3];
254 pipes[0] = cestnepasun[0];
258 if (!pipes[1]) pipes[1] = dup(0);
261 if (pipes[0]) {
262 dup2(pipes[0], 0);
263 close(pipes[0]);
267 if (pipes[1] != 1) {
268 dup2(pipes[1], 1);
269 close(pipes[1]);
298 if (pipes) {
300 pipes[0] = cestnepasun[1];
304 pipes[1] = cestnepasun[2];
322 int xpclose_both(pid_t pid, int *pipes)
324 if (pipes) {
325 close(pipes[0]);
326 close(pipes[1]);
335 int pipes[2], pid;
337 pipes[0] = isstdout ? 0 : -1;
338 pipes[1] = isstdout ? -1 : 1;
339 pid = xpopen_both(argv, pipes);
340 *pipe = pid ? pipes[!!isstdout] : -1;