From 7e41f9eed28122c2ee4fd77bdf5227e7663cd6fd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 21 Jan 2001 00:57:11 +0000 Subject: 2001-01-20 Roland McGrath * streamio.c (options): Add aliases --rdonly, --ro for -r. Add aliases --rdwr, -rw for -w. Add new option --writeonly/--wronly/-W. (readonly): Variable removed. (parse_opt): Set trivfs_allow_open for -r/-w/-W. (main): Don't set trivfs_allow_open here. Instead, use it to decide whether to set up input_buffer/output_buffer or not. (open_hook): Use trivfs_allow_open instead of readonly. Check whether read is allowed too. (trivfs_modify_stat): Likewise. (clear_buffer): Do nothing if argument is null. * streamio.c (stream_name, readonly, rdev, nperopens): Remove superfluous zero initializers. --- trans/streamio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'trans') diff --git a/trans/streamio.c b/trans/streamio.c index 13714239..c1acc8a2 100644 --- a/trans/streamio.c +++ b/trans/streamio.c @@ -104,6 +104,8 @@ buffer_writable (struct buffer *b) extern inline void clear_buffer (struct buffer *b) { + if (b == 0) + return; b->head = b->tail = b->buf; condition_broadcast (b->wait); } -- cgit v1.2.3