diff options
Diffstat (limited to 'core/read.c')
| -rw-r--r-- | core/read.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/read.c b/core/read.c index 82b74be..017fd3c 100644 --- a/core/read.c +++ b/core/read.c @@ -1,6 +1,7 @@ #include "../lib/io/io.h" #include "../lib/arg/arg.h" #include "../lib/list/list.h" +#include "../lib/sys/errno.h" #define BUF_SIZE 1024 @@ -89,6 +90,11 @@ int main(int argc, const char **argv) else fd = STDIN_FD; + if (fd < 0) { + wff(STDERR_FD, "read: %s\n", errstr[-fd]); + return -1; + } + mode_funcs[mode](fd); } |