On 12/02/2011 12:35 AM, Philip Guenther wrote:
On Thu, Dec 1, 2011 at 6:45 PM, Christiano F. Haesbaert
<haesba...@openbsd.org>  wrote:
Hi, I think we should warn() on any error, not just EPERM.
This is more consistent with the rest of the code.

ok ?
I disagree with this.  The existing message is much clearer to the
non-root mortal user that gets it and, IMO, it's clearer for the
message to be sent to stdout with the rest of the output from the
scan.

As for errors other than EPERM, well, exactly what other errors *can*
that call return in ifconfig?
The existing error message should be retained as Mr. Guenther says. An "else" clause reporting any other error is very desirable if other errors are not anticipated.

The general principle of "if an error is reported to you that you don't understand, pass it up the stack until somebody can record it or do something about it" is important. It will save the maintainer's sanity when the kernel or library changes or adds functionality. 99.9% of the reporting code will never be executed. Trade that cost against weeks of frustration.

I'd be glad to share gory descriptions of weeks spent chasing unreported errors off line.

Geoff Steckel

Reply via email to