diff options
| -rw-r--r-- | sys/src/cmd/nusb/serial/serial.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/cmd/nusb/serial/serial.c b/sys/src/cmd/nusb/serial/serial.c index 2c41398f9..ad6a93bd7 100644 --- a/sys/src/cmd/nusb/serial/serial.c +++ b/sys/src/cmd/nusb/serial/serial.c @@ -879,8 +879,11 @@ threadmain(int argc, char* argv[]) } 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); } |
