Update 'ASR3.1/TP06 Redirection tubes / pipe-ex.c'
This commit is contained in:
parent
1700abf11f
commit
cfafcb7acc
@ -18,7 +18,7 @@ int main(int argc, char const *argv[]){
|
|||||||
/*pf1f1*/
|
/*pf1f1*/
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
|
|
||||||
read(p[0], &pid, 1 );
|
read(p[0], &pid, sizeof(pid_t) );
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
sleep(3);
|
sleep(3);
|
||||||
@ -36,7 +36,7 @@ int main(int argc, char const *argv[]){
|
|||||||
|
|
||||||
//printf("while ok\n");
|
//printf("while ok\n");
|
||||||
|
|
||||||
write (p[1], &pid, 1);
|
write (p[1], &pid, sizeof(pid_t));
|
||||||
|
|
||||||
close (p[1]);
|
close (p[1]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user