From 51def2fc45d98b59be0413fcb9c25cbb0bbca211 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 14 Mar 2015 15:01:46 +0100 Subject: Fix blocking channel && channel write on circular-overflow. (see ipc.c) --- src/lib/libkogata/stdio.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/lib/libkogata') diff --git a/src/lib/libkogata/stdio.c b/src/lib/libkogata/stdio.c index 1c298ad..e62aa30 100644 --- a/src/lib/libkogata/stdio.c +++ b/src/lib/libkogata/stdio.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -7,12 +8,6 @@ fd_t stdio = 1; int getc() { - sel_fd_t fd; - fd.fd = stdio; - fd.req_flags = SEL_READ; - ASSERT(select(&fd, 1, -1)); - ASSERT(fd.got_flags & SEL_READ); - char chr; size_t sz = read(stdio, 0, 1, &chr); ASSERT(sz == 1); @@ -26,7 +21,7 @@ void putc(int c) { } void puts(char* s) { - while (*s) putc(*(s++)); + write(stdio, 0, strlen(s), s); } void getline(char* buf, size_t l) { -- cgit v1.2.3