Martin Pieuchot <[email protected]> wrote:

> On 28/02/20(Fri) 10:02, Boudewijn Dijkstra wrote:
> > Op Thu, 27 Feb 2020 17:30:34 +0100 schreef Martin Pieuchot
> > <[email protected]>:
> > > On 27/02/20(Thu) 16:58, [email protected] wrote:
> > > > >Synopsis:      boolean indicators in sensorsd.conf(5) are too 
> > > > >cumbersome
> > > > >Category:      system
> > > > >Environment:
> > > >         System      : OpenBSD 6.6
> > > >         Details     : OpenBSD 6.6 (GENERIC.MP) #372: Sat Oct 12 10:56:27
> > > > MDT 2019
> > > > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > > > 
> > > >         Architecture: OpenBSD.amd64
> > > >         Machine     : amd64
> > > > >Description:
> > > >         Some upd(4) devices use -1 for "On" and some use 1.  sysctl(8) 
> > > > and
> > > > sensorsd(8) hide this detail from the user, which makes it difficult
> > > > to define low and high values in sensorsd.conf(5).
> > > 
> > > Which device reports "-1" for which usage?  Is this from any
> > > specification or is it a workaround for your device?
> > 
> > In the misc@ thread I linked it was reported that different devices use
> > different values.  My device happens to report -1 for "On".  Given how
> > sensorsd.conf currently works, it would be most convenient if 0 and 1 were
> > the only possible values.
> 
> You're rephrasing your diff in words.  My question is: can there be any
> drawback to this approach?  Did you check the spec?  Why is your UPS
> returning -1 and not 1 in this case?  Is this the right place to fix the
> bug?

I don't understand this line of questioning.

He observes a -1 value, and the code can trivially deal with it.

If the spec says it should return 0 or 1 only, what are you going to do
not cope with the value, and tell him to warantee it?

How about believing he's seeing non-0 delivered as -1.

Reply via email to