Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2005 12:04:15 -0700
From:      Nate Lawson <nate@root.org>
To:        Fredrik Lindberg <fli+freebsd-current@shapeshifter.se>
Cc:        current@FreeBSD.org
Subject:   Re: Patch to make powerd(8) devd(8)-aware
Message-ID:  <428CE32F.20307@root.org>
In-Reply-To: <20050519104207.GA1259@shapeshifter.se>
References:  <428C1EA6.7020907@root.org> <20050519104207.GA1259@shapeshifter.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?428CE32F.20307>