summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-05-26 16:06:44 +0000
committerCharles.Forsyth <devnull@localhost>2009-05-26 16:06:44 +0000
commitb18a52b7bbe9230f3398a16cfc224f42a7cb393b (patch)
treef94aa5eec49ba9bca0a44981dfe18bcc633436a4
parentfa871c313191a5a5d28d5cbd18921daaea4d212a (diff)
20090526-1706
-rw-r--r--CHANGES2
-rw-r--r--emu/port/devfs-posix.c11
-rw-r--r--emu/port/exportfs.c2
-rw-r--r--os/port/exportfs.c2
4 files changed, 11 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 4baf5c71..7bb163a2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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);