From 8da59918c22df70eaec28150867c7e8bfd4bc1ae Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Thu, 21 May 2020 14:11:38 +0200 Subject: sdfghj --- 02_exercise/beispiele/pipe_example/pipe.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '02_exercise/beispiele/pipe_example/pipe.c') diff --git a/02_exercise/beispiele/pipe_example/pipe.c b/02_exercise/beispiele/pipe_example/pipe.c index 3589c63..422e4d5 100644 --- a/02_exercise/beispiele/pipe_example/pipe.c +++ b/02_exercise/beispiele/pipe_example/pipe.c @@ -35,26 +35,26 @@ void term(const char *msg) { int main(void) { int ret = pipe(pipe_fds); - + if (ret < 0) term("Couldn't create pipe"); - + char out_buf[] = "hello"; ret = write(pipe_fds[1], out_buf, strlen(out_buf) + 1); - + if (ret < 0) term("Couldn't write to pipe"); - + printf("send msg: %s\n", out_buf); - + char in_buf[BUF_SIZE]; memset(in_buf, 0, BUF_SIZE); - + ret = read(pipe_fds[0], in_buf, BUF_SIZE - 1); - + if (ret < 0) term("Couldn't read from pipe"); - + printf("recv msg: %s\n", in_buf); return 0; } -- cgit v1.2.3-54-g00ecf