diff options
author | Russ Cox <rsc@swtch.com> | 2008-10-08 14:59:32 -0700 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-10-08 14:59:32 -0700 |
commit | 607880ce788bbfb8585271af117a52e9359324dd (patch) | |
tree | 295336b34a490d45fa524b8bd9fa06b62c6aae5d /src/cmd/devdraw | |
parent | 6c99870701d4a71d429a26f357859416c875b2fb (diff) | |
download | plan9port-607880ce788bbfb8585271af117a52e9359324dd.tar.gz plan9port-607880ce788bbfb8585271af117a52e9359324dd.tar.bz2 plan9port-607880ce788bbfb8585271af117a52e9359324dd.zip |
devdraw/OSX: correct access to reply buffer (fixes rpc tag crash)
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r-- | src/cmd/devdraw/osx-srv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/devdraw/osx-srv.c b/src/cmd/devdraw/osx-srv.c index 9329bc2f..10baf0f3 100644 --- a/src/cmd/devdraw/osx-srv.c +++ b/src/cmd/devdraw/osx-srv.c @@ -289,6 +289,7 @@ runmsg(Wsysmsg *m) /* * Reply to m. */ +QLock replylock; void replymsg(Wsysmsg *m) { @@ -303,6 +304,8 @@ replymsg(Wsysmsg *m) if(trace) fprint(2, "-> %W\n", m); /* copy to output buffer */ n = sizeW2M(m); + + qlock(&replylock); if(n > nmbuf){ free(mbuf); mbuf = malloc(n); @@ -313,6 +316,7 @@ replymsg(Wsysmsg *m) convW2M(m, mbuf, n); if(write(4, mbuf, n) != n) sysfatal("write: %r"); + qunlock(&replylock); } /* |