[patch] Move negative checks to util.c, from acpi.c (resend)

David Zeuthen davidz at redhat.com
Fri Aug 19 07:16:15 PDT 2005


On Fri, 2005-08-19 at 09:01 +0100, Richard Hughes wrote:
> On Thu, 2005-08-18 at 13:12 +0200, Danny Kukawka wrote:
> > Again: I don't understood: What the difference for you to handle 101% as error 
> > or -1 ? "-1" Is a well defined return value at all (kernel, userspace 
> > programmes with return values >= 0).
> 
> Point taken, I'm just trying to make like easier for myself (coding
> g-p-m :-).
> 
> I agree now, "-1" makes most sense as a "unknown" value. DavidZ's idea
> of not setting the key is also a nice idea as we are not providing a
> value, although this gets tricky if the key is already set, as we will
> then have to remove the key. I vote -1.

I'd still say just omit the property if we don't know what to set it
too. Introducing magic numbers is almost always a bad idea.

Cheers,
David




More information about the hal mailing list