ref: 8fee39b90b0d4d28896002f957d5df80aae6130c
parent: 860e8101c3dbc3477f5ee644990cea17f8830fe9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Mar 8 12:06:37 EDT 2020
nusb/usbd: cleanup processes on unmount this makes sure that when postsharesrv() fails (for example because the shr file already exists), the worker process gets killed and all file descriptors to devusb get closed.
--- a/sys/src/cmd/nusb/usbd/usbd.c
+++ b/sys/src/cmd/nusb/usbd/usbd.c
@@ -338,8 +338,15 @@
}
}
+static void
+usbdend(Srv*)
+{+ postnote(PNGROUP, getpid(), "shutdown");
+}
+
Srv usbdsrv = {.start = usbdstart,
+ .end = usbdend,
.attach = usbdattach,
.walk1 = usbdwalk,
.read = usbdread,
--
⑨