Re: readdir man page

2012-02-04 Thread Kenneth R Westerback
On Thu, Feb 02, 2012 at 10:29:00PM -0700, Philip Guenther wrote: > On Thu, 2 Feb 2012, Philip Guenther wrote: > > I also think readdir() should set errno if it detects an invalid > > seekdir(). EINVAL seems correct. > > Here's a diff for this bit. > > oks? > > > Philip Guenther > > > Index:

Re: readdir man page

2012-02-03 Thread Christiano F. Haesbaert
On 3 February 2012 03:29, Philip Guenther wrote: > On Thu, 2 Feb 2012, Philip Guenther wrote: >> I also think readdir() should set errno if it detects an invalid >> seekdir(). EINVAL seems correct. > > Here's a diff for this bit. > > oks? > > > Philip Guenther > > > Index: gen/readdir.c > ===

Re: readdir man page

2012-02-03 Thread Christiano F. Haesbaert
On 3 February 2012 02:50, Philip Guenther wrote: > On Thu, Feb 2, 2012 at 5:29 AM, Christiano F. Haesbaert > wrote: >> On 2 February 2012 10:13, Laurence Tratt wrote: >>> To my surprise (and a couple of hours debugging later), readdir does not >>> necessarily set errno even if NULL is returned.

Re: readdir man page

2012-02-03 Thread Laurence Tratt
On Thu, Feb 02, 2012 at 09:50:45PM -0700, Philip Guenther wrote: >>> The current man page doesn't claim that errno is always set but one might >>> reasonably assume that it is: certainly, it seems a horribly easy way of >>> introducing bugs (at least for idiots such as myself). [...] [Christiano]

Re: readdir man page

2012-02-02 Thread Philip Guenther
On Thu, 2 Feb 2012, Philip Guenther wrote: > I also think readdir() should set errno if it detects an invalid > seekdir(). EINVAL seems correct. Here's a diff for this bit. oks? Philip Guenther Index: gen/readdir.c === RCS file:

Re: readdir man page

2012-02-02 Thread Philip Guenther
On Thu, Feb 2, 2012 at 5:29 AM, Christiano F. Haesbaert wrote: > On 2 February 2012 10:13, Laurence Tratt wrote: >> To my surprise (and a couple of hours debugging later), readdir does not >> necessarily set errno even if NULL is returned. This is rather confusing >> because if NULL is returned t

Re: readdir man page

2012-02-02 Thread Christiano F. Haesbaert
On 2 February 2012 10:13, Laurence Tratt wrote: > To my surprise (and a couple of hours debugging later), readdir does not > necessarily set errno even if NULL is returned. This is rather confusing > because if NULL is returned two things might have happened: > > 1) The end of the directory has b

readdir man page

2012-02-02 Thread Laurence Tratt
To my surprise (and a couple of hours debugging later), readdir does not necessarily set errno even if NULL is returned. This is rather confusing because if NULL is returned two things might have happened: 1) The end of the directory has been reached in a normal fashion; errno won't have be