NetBSD Problem Report #52430

From www@NetBSD.org  Tue Jul 25 23:36:24 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 343617A208
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 25 Jul 2017 23:36:24 +0000 (UTC)
Message-Id: <20170725233622.960927A290@mollari.NetBSD.org>
Date: Tue, 25 Jul 2017 23:36:22 +0000 (UTC)
From: edgar@pettijohn-web.com
Reply-To: edgar@pettijohn-web.com
To: gnats-bugs@NetBSD.org
Subject: devpubd: DRVGETEVENT failed: Resource temporarily unavailable
X-Send-Pr-Version: www-1.0

>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;
 }

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.