Date: Wed, 13 Apr 2005 13:27:03 -0500 From: Garance A Drosihn <drosih@rpi.edu> To: Peter Jeremy <PeterJeremy@optushome.com.au>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: strtonum(3) in FreeBSD? Message-ID: <p06210236be831350aba9@[128.113.24.47]> In-Reply-To: <20050413075956.GO89047@cirb503493.alcatel.com.au> References: <1113332762.27362.29.camel@localhost.localdomain> <20050412195700.GN89047@cirb503493.alcatel.com.au> <20050413030814.GA21318@VARK.MIT.EDU> <20050413075956.GO89047@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
At 5:59 PM +1000 4/13/05, Peter Jeremy wrote: > >> but this is unintuitive to anyone who > >is used to the broken POSIX way of doing it. > >I would dispute the 'broken' adjective. Having errno only affected by >errors means that you can issue a series of system calls and determine >that something failed - which may be enough. Uh, no. This can get you into trouble, if one of those system routines called some other system routine, and that other system routine "failed", but in a way which is not really an error for the routine you called. This happens if a system routine is calling 'stat()' for some *optional* config file, for instance. It is not an error to you at all if that optional config file does not exist, but errno will have been set. Note that I have lost time debugging non-problems because of programmers who used this "time-saving trick" of just checking errno (instead of checking the actual return-code from the routines they called). It is very annoying. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p06210236be831350aba9>