git: 9front

Download patch

ref: 2cc71373f4ade25f562ea9b4713fa01efd422b7f
parent: 03bb0782aa959be2ef6cf66b6b75d3bc01165864
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun May 5 00:28:50 EDT 2013

devip: dont raise error() out of Fsprotocone()

Fsprotoclone() is not supposed to raise error, but return nil.
ipopen() seemed to assume otherwise as it setup error label
before calling Fsprotoclone(). fix ipopen(), make Fsprotoclone()
return nil instead of raising error.

--- a/sys/src/9/ip/devip.c
+++ b/sys/src/9/ip/devip.c
@@ -407,13 +407,8 @@
 	case Qclone:
 		p = f->p[PROTO(c->qid)];
 		qlock(p);
-		if(waserror()){
-			qunlock(p);
-			nexterror();
-		}
 		cv = Fsprotoclone(p, ATTACHER(c));
 		qunlock(p);
-		poperror();
 		if(cv == nil) {
 			error(Enodev);
 			break;
@@ -1285,7 +1280,7 @@
 		if(c == nil){
 			c = malloc(sizeof(Conv));
 			if(c == nil)
-				error(Enomem);
+				return nil;
 			if(waserror()){
 				qfree(c->rq);
 				qfree(c->wq);
@@ -1293,7 +1288,7 @@
 				qfree(c->sq);
 				free(c->ptcl);
 				free(c);
-				nexterror();
+				return nil;
 			}
 			c->p = p;
 			c->x = pp - p->conv;
--