NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/52430: devpubd: DRVGETEVENT failed: Resource temporarily unavailable



>Number:         52430
>Category:       bin
>Synopsis:       devpubd: DRVGETEVENT failed: Resource temporarily unavailable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 25 23:40:00 +0000 2017
>Originator:     Edgar Pettijohn
>Release:        NetBSD 7.1 Tue Jul 25 18:29:06 CDT 2017
>Organization:
>Environment:
NetBSD 7.1 (GENERIC.201703111743Z) amd64
>Description:
I would get the 'DRVGETEVENT failed: Resource temporarily unavailable' error frequently while I was playing around with writing some scripts for devpubd. While doing so I would frequently start and stop the service.
>How-To-Repeat:
# devpubd -f
# CTRL-C
# devpubd -f
>Fix:
I believe its because it fails to close /dev/drvctl. This patch against 7.1 works for me, unfortunantly I couldn't get current to compile so I gave up.

Index: devpubd.c
===================================================================
RCS file: /cvsroot/src/sbin/devpubd/devpubd.c,v
retrieving revision 1.2.20.1
diff -u -r1.2.20.1 devpubd.c
--- devpubd.c   17 Feb 2015 14:45:31 -0000      1.2.20.1
+++ devpubd.c   25 Jul 2017 23:26:57 -0000
@@ -68,6 +68,12 @@
 #define        DEVPUBD_ATTACH_EVENT    "device-attach"
 #define        DEVPUBD_DETACH_EVENT    "device-detach"
 
+static void
+cleanup(void)
+{
+       close(drvctl_fd);
+}
+
 __dead static void
 devpubd_exec(const char *path, char * const *argv)
 {
@@ -298,5 +304,7 @@
 
        devpubd_eventloop();
 
+       atexit(cleanup);
+
        return EXIT_SUCCESS;
 }



Home | Main Index | Thread Index | Old Index