Mail Archives: cygwin/2005/08/26/11:22:22
> >Because POSIX states that buf is indeterminate on error, and
> >because Corrina's patch caused a regression (ie. 1.5.18 was
> >setting buf[0] to 0 on error). QofI states that we might as
> >well make the indeterminate buffer useful, in case a user
> >forgets to check the return value being NULL.
>
> linux leaves the buffer alone, as far as I can tell.
Well, we should be consistent. In 1.5.18, realpath ALWAYS
set buffer[0] to 0 on error. In 20050825, it sets buffer[0]
to 0 on all errors except EINVAL. Either we never touch
buffer on error (a change from 1.5.18, but justifiable if Linux
does so), or we always do the same thing (either my patch
to cygwin-patches, or change it to also leave buffer alone
on ENOENT, etc.). There's also the matter of the comment
in path.cc about the idea of setting buffer to the component
that failed resolution, although that is not done in cygwin
(ie. realpath("/tmp/nonesuch/x/", buf) returns NULL with
ENOENT, but leaves buf as "/tmp/nonesuch"), also a valid
QofI approach but much harder to implement.
--
Eric Blake
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -