summaryrefslogtreecommitdiff
path: root/emu
diff options
context:
space:
mode:
Diffstat (limited to 'emu')
-rw-r--r--emu/port/devfs-posix.c11
-rw-r--r--emu/port/exportfs.c2
2 files changed, 8 insertions, 5 deletions
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);