tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH 1/6] fix ambiguous errno treating after mktime()
On Mon, Sep 01, 2008 at 04:38:17AM +0000, David Holland wrote:
> On Mon, Sep 01, 2008 at 09:46:26AM +0700, Robert Elz wrote:
> > Date: Sun, 31 Aug 2008 18:34:01 +0000
> > From: David Holland <dholland-tech%netbsd.org@localhost>
> > Message-ID: <20080831183401.GA5824%netbsd.org@localhost>
> >
> > | Right, but, as previously noted, it is desirable for functions that
> > | are cognizant of errno to leave errno unchanged if they have not
> > | failed, regardless of what the formal definition says.
> >
> > Why? What conceivable benefit does that bring anyone?
>
> Principle of least surprise?
Confusing people by adding to their expectations...
Historically fopen() of a file will almost always change errno because
it uses TCGETA (or similar) to determine whether to use line or block
buffering.
Programs that check errno to determine if calls have failed are broken.
David
--
David Laight: david%l8s.co.uk@localhost
Home |
Main Index |
Thread Index |
Old Index