changeset: 2041:c42d820e77e6
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Mar 26 17:21:05 2007 -0400
summary: Fixed some bugs.
diff -r 79af59fac5ef -r c42d820e77e6 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Mon Mar 26 15:55:11 2007 -0400
+++ b/cmd/wmii/fs.c Mon Mar 26 17:21:05 2007 -0400
@@ -515,7 +515,7 @@ fs_attach(Ixp9Req *r) {
FileId *f = get_file();
f->tab = dirtab[FsRoot][0];
f->tab.name = estrdup("/");
- f->content.ref = nil; /* shut up valgrind */
+ f->content.ref = nil;
r->fid->aux = f;
r->fid->qid.type = f->tab.qtype;
r->fid->qid.path = QID(f->tab.type, 0);
diff -r 79af59fac5ef -r c42d820e77e6 cmd/wmiir.c
--- a/cmd/wmiir.c Mon Mar 26 15:55:11 2007 -0400
+++ b/cmd/wmiir.c Mon Mar 26 17:21:05 2007 -0400
@@ -22,18 +22,18 @@ usage() {
/* Utility Functions */
static void
-write_data(IxpCFid *fid) {
+write_data(IxpCFid *fid, char *name) {
void *buf;
uint len;
buf = ixp_emalloc(fid->iounit);;
while((len = read(0, buf, fid->iounit)) > 0)
if(ixp_write(fid, buf, len) != len)
- fatal("cannot write file: %s\n", errstr);
+ fatal("cannot write file '%s': %s\n", name, errstr);
/* do an explicit empty write when no writing has been done yet */
if(fid->offset == 0)
if(ixp_write(fid, buf, 0) != 0)
- fatal("cannot write file: %s\n", errstr);
+ fatal("cannot write file '%s': %s\n", name, errstr);
free(buf);
}
@@ -109,7 +109,7 @@ xwrite(int argc, char *argv[]) {
if(fid == nil)
fatal("Can't open file '%s': %s\n", file, errstr);
- write_data(fid);
+ write_data(fid, file);
return 0;
}
@@ -161,12 +161,12 @@ xcreate(int argc, char *argv[]) {
}ARGEND;
file = EARGF(usage());
- fid = ixp_create(client, file, 0777, P9_OREAD);
+ fid = ixp_create(client, file, 0777, P9_OWRITE);
if(fid == nil)
fatal("Can't create file '%s': %s\n", file, errstr);
if((fid->qid.type&P9_DMDIR) == 0)
- write_data(fid);
+ write_data(fid, file);
return 0;
}
Received on Mon Mar 26 2007 - 23:22:58 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:26 UTC