write_data in ixpc from libixp

3 views
Skip to first unread message

sqweek

unread,
Aug 25, 2008, 7:44:30 PM8/25/08
to 9p-ha...@googlegroups.com
Does this look odd to anyone else?

static void
write_data(IxpCFid *fid, char *name) {
void *buf;
uint len;

buf = emalloc(fid->iounit);;
do {
len = read(0, buf, fid->iounit);
if(len >= 0 && ixp_write(fid, buf, len) != len)
fatal("cannot write file '%s': %s\n", name, ixp_errbuf());
} while(len > 0);

free(buf);
}

Specifically, if(len >= 0 ..., which causes a 0 byte write at EOF. I
don't see any other 9p clients that behave this way.
-sqweek

Reply all
Reply to author
Forward
0 new messages