From 279f3336a8f6b31ca38bdd272c73aebd68fa88fe Mon Sep 17 00:00:00 2001 From: Miguel Date: Sat, 13 Oct 2018 00:57:28 +0200 Subject: ncurses arrow keys working etc --- fs/fd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fs/fd.c') diff --git a/fs/fd.c b/fs/fd.c index 740bf35..a9ca63a 100644 --- a/fs/fd.c +++ b/fs/fd.c @@ -246,6 +246,8 @@ int fds_from_pipe(fd pipefds[2]) mem+=4; *mem=1; + read.can_write=0; + read.read=pipe_get; wrt.read=0; @@ -312,6 +314,11 @@ fd fd_from_sysfs(void(*g)(ringbuffer *r,void (*f)(ringbuffer *r,char *fmt, ...)) return f; } +bool fifo_can_write(fifo *f) +{ + return !(f->full(f->data)); +} + fd fd_from_fifo(fifo* fif) { fd f; @@ -323,5 +330,6 @@ fd fd_from_fifo(fifo* fif) f.has=fifo_has; f.dupl=default_dupl; f.close=default_close; + f.can_write=fifo_can_write; return f; } -- cgit v1.2.3