summaryrefslogtreecommitdiff
path: root/emu/Nt
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-05-26 14:42:13 +0000
committerCharles.Forsyth <devnull@localhost>2009-05-26 14:42:13 +0000
commitfa871c313191a5a5d28d5cbd18921daaea4d212a (patch)
treea2c9ec8a79e5384ad45103934aaaa01ba4010523 /emu/Nt
parentda9e999288115cfb2c96bfa69ec8589d3d714e31 (diff)
20090526-1541
Diffstat (limited to 'emu/Nt')
-rw-r--r--emu/Nt/os.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/emu/Nt/os.c b/emu/Nt/os.c
index 9bf6736a..1c49fc07 100644
--- a/emu/Nt/os.c
+++ b/emu/Nt/os.c
@@ -495,7 +495,15 @@ close(int fd)
int
read(int fd, void *buf, uint n)
{
- if(!ReadFile(ntfd2h(fd), buf, n, &n, NULL))
+ HANDLE h;
+
+ if(fd == 0)
+ h = kbdh;
+ else
+ h = ntfd2h(fd);
+ if(h == INVALID_HANDLE_VALUE)
+ return -1;
+ if(!ReadFile(h, buf, n, &n, NULL))
return -1;
return n;
}