From owner-freebsd-current@FreeBSD.ORG Fri May 20 10:25:34 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5015216A4CE; Fri, 20 May 2005 10:25:34 +0000 (GMT) Received: from mail.hamnpolare.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60F5243D91; Fri, 20 May 2005 10:25:33 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mail.hamnpolare.net (Postfix) with ESMTP id 11DD21A6F0; Fri, 20 May 2005 12:25:31 +0200 (CEST) Received: from mail.hamnpolare.net ([127.0.0.1])port 10024) with ESMTP id 46009-11; Fri, 20 May 2005 12:25:29 +0200 (CEST) Received: from biocandy.shapeshifter.se (h99n2fls32o270.telia.com [217.210.25.99]) by mail.hamnpolare.net (Postfix) with ESMTP id BA29A1A6D5; Fri, 20 May 2005 12:25:29 +0200 (CEST) Received: by biocandy.shapeshifter.se (Postfix, from userid 1001) id 80B90438E; Fri, 20 May 2005 12:25:29 +0200 (CEST) Date: Fri, 20 May 2005 12:25:29 +0200 From: Fredrik Lindberg To: Nate Lawson Message-ID: <20050520102529.GA1382@shapeshifter.se> References: <428C1EA6.7020907@root.org> <20050519104207.GA1259@shapeshifter.se> <428CE32F.20307@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <428CE32F.20307@root.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: at example.com cc: Warner Losh cc: current@FreeBSD.org Subject: Re: Patch to make powerd(8) devd(8)-aware X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 10:25:34 -0000 On Thu, May 19, 2005 at 12:04:15PM -0700, Nate Lawson (nate@root.org) wrote: > Fredrik Lindberg wrote: > >On Wed, May 18, 2005 at 10:05:42PM -0700, Nate Lawson (nate@root.org) > >wrote: > > > >>I appreciate you working on a patch for this. However, I'd prefer the > >>work on the devd side go into making devctl a clonable device or follow > >>the bpf route and hook up /dev/devctl0,1,2,... If you start using the > >>/var/run/devd.pipe, it's not available for other consumers. > > > >Yes, devctl should probably be able to have more readers, I won't argue > >with that. > >However, devd allows any number of consumers to the devd.pipe. I've had > >upto 4 programs reading devd.pipe simultaneously and they all got the same > >data. > > Ah, I wasn't aware of that. I thought there might be a race for who got > each message. This is fine then, and perhaps we should retire devctl as > a way to read messages since it is limited for that purpose and > duplicates the pipe. We could keep it around for reverse signaling > (sending messages to the kernel, which is needed eventually). > > >>Other comments: > >>style(9) long sscanf line > > > > > >I'm familiar with style(9), however I don't recall anything about sscanf, > >could you > >please explain the correct behaviour in this case (except trying to > >reducing indent) > > I just think you should wrap the lines >80 cols. Pretty easy to do this > by outdenting the string. Example: > > printf( > "a really long string but less than 80 cols\n"); > > >>extra newlines inserted into existing code > >>change read() in devd_read() to return on error instead of running > >>sscanf -- this will allow the indent to be reduced. > > > >My mistakes, sorry. > > No problems, thanks for the work. With these changes, I'm fine with the > patch being committed. I hope you can also fix the main loop soft error > cases as well. > > -- > Nate A day or two back I posted a second patch which fixed the soft error cases. I've updated it to fix the above issues too. It's avaiable at http://shapeshifter.se/~fli/freebsd/powerd.patch Fredrik Lindberg