wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit f137735249b8fe732de47ae5ccbc92de12953a84
parent ec0d3809c816ba8dfb7e9857e484cb31677a9788
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon, 30 Jan 2006 19:13:54 +0200

fixed iounit based issues in ixp2, wmiibar uses 256 byte iounit (in this fs we don't need more)


Diffstat:
cmd/wmiibar.c | 7+++----
cmd/wmiir2.c | 1+
libixp2/client.c | 14+++++---------
3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/cmd/wmiibar.c b/cmd/wmiibar.c @@ -92,10 +92,10 @@ static char *version[] = { static void usage() { - fprintf(stderr, "%s %d", + fprintf(stderr, "%s", "usage: wmiibar -a <server address> [-v]\n" " -a server address \n" - " -v version info\n", 0); + " -v version info\n"); exit(1); } @@ -443,8 +443,7 @@ xopen(IXPConn *c) } c->fcall->id = ROPEN; c->fcall->qid = m->qid; - c->fcall->iounit = c->fcall->maxmsg - - (sizeof(unsigned char) + sizeof(unsigned short) + 2 * sizeof(unsigned int)); + c->fcall->iounit = 256; return 0; } diff --git a/cmd/wmiir2.c b/cmd/wmiir2.c @@ -43,6 +43,7 @@ write_data(unsigned int fid) size_t len = 0; while((len = read(0, data, c.fcall.iounit)) > 0) { + fprintf(stderr, "read=%d, bufsz=%d\n", len, c.fcall.iounit); if(ixp_client_write (&c, fid, offset, len, data) != len) { fprintf(stderr, "wmiir: cannot write file: %s\n", c.errstr); diff --git a/libixp2/client.c b/libixp2/client.c @@ -137,10 +137,8 @@ int ixp_client_read(IXPClient * c, unsigned int fid, unsigned long long offset, void *result, unsigned int res_len) { - unsigned int bytes = - c->fcall.maxmsg - (sizeof(unsigned char) + sizeof(unsigned short) + - 2 * sizeof(unsigned int) + - sizeof(unsigned long long)); + unsigned int bytes = c->fcall.iounit; + /* read */ c->fcall.id = TREAD; c->fcall.tag = IXP_NOTAG; @@ -158,11 +156,9 @@ ixp_client_write(IXPClient * c, unsigned int fid, unsigned long long offset, unsigned int count, unsigned char *data) { - if(count > - c->fcall.maxmsg - (sizeof(unsigned char) + sizeof(unsigned short) + - 2 * sizeof(unsigned int) + - sizeof(unsigned long long))) { - c->errstr = "message size exceeds buffer size"; + if(count > c->fcall.iounit) + { + c->errstr = "iounit exceeded"; return -1; } /* write */