diff options
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | emu/port/devfs-posix.c | 11 | ||||
| -rw-r--r-- | emu/port/exportfs.c | 2 | ||||
| -rw-r--r-- | os/port/exportfs.c | 2 |
4 files changed, 11 insertions, 6 deletions
@@ -1,5 +1,7 @@ 20090526 emu/Nt/os.c allow /dev/hoststdin input on file or pipe (thanks to caerwyn, issue 173) + emu/port/devfs-posix.c correct handling of error return from pread (issue 172, but goes beyond that) + emu/port/exportfs.c os/port/exportfs.c use vlong for offset 20090524 appl/cmd/tarfs.b dis/tarfs.dis - remove accidentally small limit on file size in tar file (issue 172) 20090521 diff --git a/emu/port/devfs-posix.c b/emu/port/devfs-posix.c index bd1d9a94..c80406cb 100644 --- a/emu/port/devfs-posix.c +++ b/emu/port/devfs-posix.c @@ -401,10 +401,13 @@ fsread(Chan *c, void *va, long n, vlong offset) qunlock(&FS(c)->oq); }else{ r = pread(FS(c)->fd, va, n, offset); - if(r < 0 && (errno == ESPIPE || errno == EPIPE)){ - r = read(FS(c)->fd, va, n); - if(r < 0) - oserror(); + if(r < 0){ + if(errno == ESPIPE || errno == EPIPE){ + r = read(FS(c)->fd, va, n); + if(r >= 0) + return r; + } + oserror(); } } return r; diff --git a/emu/port/exportfs.c b/emu/port/exportfs.c index 1feae7ae..a52b3239 100644 --- a/emu/port/exportfs.c +++ b/emu/port/exportfs.c @@ -1027,7 +1027,7 @@ Exread(Export *fs, Fcall *t, Fcall *r) Fid *f; Chan *c; Lock *cl; - long off; + vlong off; int dir, n, seek; f = Exgetfid(fs, t->fid); diff --git a/os/port/exportfs.c b/os/port/exportfs.c index c8755fa8..aee93b33 100644 --- a/os/port/exportfs.c +++ b/os/port/exportfs.c @@ -1053,7 +1053,7 @@ Exread(Export *fs, Fcall *t, Fcall *r) { Fid *f; Chan *c; - long off; + vlong off; int dir, n, seek; f = Exgetfid(fs, t->fid); |
