shithub: drawterm

Download patch

ref: 261a80f05dcfb2bc8fa98093a293abfc67f24394
parent: 6ffcc16c81afebbe735eaed7622659b144edaf07
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon May 30 04:35:39 EDT 2016

remove unreachable sysfatal() calls after exportfs(), exits(nil) on eof in exportfs

--- a/cpu.c
+++ b/cpu.c
@@ -148,7 +148,6 @@
 
 	/* Begin serving the namespace */
 	exportfs(fd);
-	sysfatal("starting exportfs: %r");
 }
 
 void
@@ -202,7 +201,6 @@
 
 	/* Begin serving the gnot namespace */
 	exportfs(fd);
-	sysfatal("starting exportfs: %r");
 }
 
 void
--- a/exportfs/exportfs.c
+++ b/exportfs/exportfs.c
@@ -80,7 +80,7 @@
 		DEBUG(DFD, "read9p...");
 		n = read9pmsg(netfd, r->buf, messagesize);
 		if(n <= 0)
-			fatal("eof: n=%d %r", n);
+			fatal(nil);
 
 		if(convM2S(r->buf, n, &r->work) == 0){
 			iprint("convM2S %d byte message\n", n);
@@ -489,7 +489,7 @@
 	char buf[ERRMAX];
 	va_list arg;
 
-	if (s) {
+	if (s != nil) {
 		va_start(arg, s);
 		vsnprint(buf, ERRMAX, s, arg);
 		va_end(arg);
@@ -499,10 +499,10 @@
 //	for(m = Proclist; m; m = m->next)
 //		postnote(PNPROC, m->pid, "kill");
 
-	DEBUG(DFD, "%s\n", buf);
-	if (s) 
-		sysfatal(buf);
-	else
-		sysfatal("");
+	if (s != nil) { 
+		DEBUG(DFD, "%s\n", buf);
+		sysfatal("%s", buf);
+	} else
+		exits(nil);
 }
 
--- a/exportfs/exportfs.h
+++ b/exportfs/exportfs.h
@@ -145,4 +145,4 @@
 
 #define notify(x)
 #define noted(x)
-#define exits(x)
+