verzia 1.1, 2001/12/13 17:33:41 |
verzia 1.2, 2001/12/16 20:44:38 |
Riadok 29 int main(int argc, char **argv) |
|
Riadok 29 int main(int argc, char **argv) |
|
} |
} |
|
|
if (pipe(pipe0) |
if (pipe(pipe0) |
|| pipe(pipe1) |
|| pipe(pipe1) |
|| pipe(pipe2)) { |
|| pipe(pipe2)) { |
puts("pipe() failure"); |
puts("pipe() failure"); |
return 1; |
return 1; |
} |
} |
Riadok 38 int main(int argc, char **argv) |
|
Riadok 38 int main(int argc, char **argv) |
|
/* |
/* |
fcntl(pipe1[1], F_SETFL, O_NONBLOCK|O_NDELAY); |
fcntl(pipe1[1], F_SETFL, O_NONBLOCK|O_NDELAY); |
fcntl(pipe2[1], F_SETFL, O_NONBLOCK|O_NDELAY); |
fcntl(pipe2[1], F_SETFL, O_NONBLOCK|O_NDELAY); |
*/ |
|
|
|
sh_unset_nodelay_mode(0); |
sh_unset_nodelay_mode(0); |
sh_unset_nodelay_mode(pipe1[1]); |
sh_unset_nodelay_mode(pipe1[1]); |
sh_unset_nodelay_mode(pipe1[2]); |
sh_unset_nodelay_mode(pipe1[2]); |
|
*/ |
|
|
switch (pid = fork()) { |
switch (pid = fork()) { |
case -1: |
case -1: |
Riadok 52 int main(int argc, char **argv) |
|
Riadok 52 int main(int argc, char **argv) |
|
|
|
case 0: /* Child */ |
case 0: /* Child */ |
if (dup2(pipe0[0], 0) == -1 |
if (dup2(pipe0[0], 0) == -1 |
|| dup2(pipe1[1], 1) == -1 |
|| dup2(pipe1[1], 1) == -1 |
|| dup2(pipe2[1], 2) == -1) { |
|| dup2(pipe2[1], 2) == -1) { |
puts("dup2() failure"); |
puts("dup2() failure"); |
return 1; |
return 1; |
} |
} |
Riadok 175 int give_terminal_to (pid_t pgrp, int sh |
|
Riadok 175 int give_terminal_to (pid_t pgrp, int sh |
|
/* Maybe we should print an error message? */ |
/* Maybe we should print an error message? */ |
#if 0 |
#if 0 |
sys_error ("tcsetpgrp(%d) failed: pid %ld to pgrp %ld", |
sys_error ("tcsetpgrp(%d) failed: pid %ld to pgrp %ld", |
shell_tty, (long)getpid(), (long)pgrp); |
shell_tty, (long)getpid(), (long)pgrp); |
#endif |
#endif |
r = -1; |
r = -1; |
} |
} |