From 7a85384e4794f4cda49bd83c27254b1f44229a4c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 30 Oct 2018 16:17:34 +0100 Subject: [PATCH] sh should read from fd 0 (stdin) instead of /dev/keyboard. --- Userland/sh.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Userland/sh.cpp b/Userland/sh.cpp index b5ce26e329..069cd48594 100644 --- a/Userland/sh.cpp +++ b/Userland/sh.cpp @@ -159,11 +159,6 @@ int main(int, char**) int linedx = 0; linebuf[0] = '\0'; - int fd = 0; // open("/dev/keyboard", O_RDONLY); - if (fd == -1) { - printf("failed to open /dev/keyboard :(\n"); - return 1; - } { char cwdbuf[1024]; getcwd(cwdbuf, sizeof(cwdbuf)); @@ -172,7 +167,7 @@ int main(int, char**) prompt(); for (;;) { char keybuf[16]; - ssize_t nread = read(fd, keybuf, sizeof(keybuf)); + ssize_t nread = read(0, keybuf, sizeof(keybuf)); if (nread < 0) { printf("failed to read :(\n"); return 2;