shithub: riscv

Download patch

ref: f8cbd5d12fbbb6834d6c703b91b5f21485373873
parent: 319bb17e1c1349ffb3c51c4b7654142050984772
author: cinap_lenrek <[email protected]>
date: Sun Sep 15 12:21:43 EDT 2013

nusb/serial: set exit status

--- a/sys/src/cmd/nusb/serial/serial.c
+++ b/sys/src/cmd/nusb/serial/serial.c
@@ -879,8 +879,11 @@
 	}
 
 	qunlock(ser);
-	if(nports > 0){
-		snprint(buf, sizeof buf, "%d.serial", dev->id);
-		threadpostsharesrv(&serialfs, nil, "usb", buf);
-	}
+
+	if(nports == 0)
+		threadexits("no ports");
+
+	snprint(buf, sizeof buf, "%d.serial", dev->id);
+	threadpostsharesrv(&serialfs, nil, "usb", buf);
+	threadexits(0);
 }