tlibventi: handle rpc when not connected - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit fc638f7bd4d11352c44c8d4c6fc6d15e90f17ddb
(DIR) parent d33a4d7f1b8fcc524c8b56a0d5a2005fbd9d1df0
(HTM) Author: David du Colombier <0intro@gmail.com>
Date: Mon, 16 Jan 2012 16:53:08 -0500
libventi: handle rpc when not connected
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5491051
Diffstat:
M src/libventi/rpc.c | 6 ++++++
1 file changed, 6 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/libventi/rpc.c b/src/libventi/rpc.c
t@@ -37,6 +37,12 @@ _vtrpc(VtConn *z, Packet *p, VtFcall *tx)
uchar tag, buf[2], *top;
Rwait *r, *rr;
+ if(z == nil){
+ werrstr("not connected");
+ packetfree(p);
+ return nil;
+ }
+
/* must malloc because stack could be private */
r = vtmallocz(sizeof(Rwait));