From fe393882506834722eda40d94289133366f5a210 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 8 Mar 2020 16:06:37 +0100 Subject: 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. --- sys/src/cmd/nusb/usbd/usbd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/src/cmd/nusb/usbd/usbd.c b/sys/src/cmd/nusb/usbd/usbd.c index fa56f6866..4c2d70100 100644 --- a/sys/src/cmd/nusb/usbd/usbd.c +++ b/sys/src/cmd/nusb/usbd/usbd.c @@ -338,8 +338,15 @@ usbdstart(Srv*) } } +static void +usbdend(Srv*) +{ + postnote(PNGROUP, getpid(), "shutdown"); +} + Srv usbdsrv = { .start = usbdstart, + .end = usbdend, .attach = usbdattach, .walk1 = usbdwalk, .read = usbdread, -- cgit v1.2.3