aboutsummaryrefslogtreecommitdiff
path: root/src/lib9pclient
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9pclient')
-rw-r--r--src/lib9pclient/open.c3
-rw-r--r--src/lib9pclient/write.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lib9pclient/open.c b/src/lib9pclient/open.c
index e9fb981b..2317bbb7 100644
--- a/src/lib9pclient/open.c
+++ b/src/lib9pclient/open.c
@@ -7,6 +7,7 @@
CFid*
fsopen(CFsys *fs, char *name, int mode)
{
+ char e[ERRMAX];
CFid *fid;
Fcall tx, rx;
@@ -16,7 +17,9 @@ fsopen(CFsys *fs, char *name, int mode)
tx.fid = fid->fid;
tx.mode = mode;
if(_fsrpc(fs, &tx, &rx, 0) < 0){
+ rerrstr(e, sizeof e);
fsclose(fid);
+ errstr(e, sizeof e);
return nil;
}
fid->mode = mode;
diff --git a/src/lib9pclient/write.c b/src/lib9pclient/write.c
index f4eab964..9f908589 100644
--- a/src/lib9pclient/write.c
+++ b/src/lib9pclient/write.c
@@ -53,7 +53,7 @@ fspwrite(CFid *fid, void *buf, long n, vlong offset)
want = n - tot;
if(want > msize)
want = msize;
- got = _fspwrite(fid, buf, want, offset);
+ got = _fspwrite(fid, buf+tot, want, offset);
first = 0;
if(got < 0){
if(tot == 0)