From cfafcb7acc51bc893b12a73f5f47a670cf024eb8 Mon Sep 17 00:00:00 2001 From: lefevres Date: Mon, 6 Dec 2021 17:40:32 +0100 Subject: [PATCH] Update 'ASR3.1/TP06 Redirection tubes / pipe-ex.c' --- ASR3.1/TP06 Redirection tubes / pipe-ex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ASR3.1/TP06 Redirection tubes / pipe-ex.c b/ASR3.1/TP06 Redirection tubes / pipe-ex.c index 55ebcb0..dc1d3c9 100644 --- a/ASR3.1/TP06 Redirection tubes / pipe-ex.c +++ b/ASR3.1/TP06 Redirection tubes / pipe-ex.c @@ -18,7 +18,7 @@ int main(int argc, char const *argv[]){ /*pf1f1*/ if (fork() == 0) { - read(p[0], &pid, 1 ); + read(p[0], &pid, sizeof(pid_t) ); while (1) { sleep(3); @@ -36,7 +36,7 @@ int main(int argc, char const *argv[]){ //printf("while ok\n"); - write (p[1], &pid, 1); + write (p[1], &pid, sizeof(pid_t)); close (p[1]);