From owner-freebsd-hackers@freebsd.org Wed Feb 14 15:01:55 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2763F05313 for ; Wed, 14 Feb 2018 15:01:55 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB807C2E6 for ; Wed, 14 Feb 2018 15:01:54 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 88AF25646B; Wed, 14 Feb 2018 09:01:53 -0600 (CST) Subject: Re: select call in devd To: Eitan Adler , FreeBSD Hackers , Warner Losh , zrj@dragonflybsd.org References: From: Eric van Gyzen Message-ID: Date: Wed, 14 Feb 2018 09:01:49 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 15:01:55 -0000 On 02/14/2018 01:13, Eitan Adler wrote: > Hi all, > > select(2) is declared with restrict for the pointers for fd. Can y'all > confirm this is the correct fix? > > It is only lightly tested (it seems to do its job on my machine) > > Index: devd.cc > =================================================================== > --- devd.cc (revision 329192) > +++ devd.cc (working copy) > @@ -1021,7 +1021,7 @@ event_loop(void) > tv.tv_usec = 0; > FD_ZERO(&fds); > FD_SET(fd, &fds); > - rv = select(fd + 1, &fds, &fds, &fds, &tv); > + rv = select(fd + 1, &fds, NULL, NULL, &tv); > // No events -> we've processed all pending events > if (rv == 0) { > devdlog(LOG_DEBUG, "Calling daemon\n"); Looks good to me. Eric