svn commit: r297408 - head/lib/libc/stdio

Andrey Chernov ache at freebsd.org
Wed Mar 30 10:10:14 UTC 2016


On 30.03.2016 9:13, Pedro F. Giffuni wrote:
>  	 */
> +	sverrno = 0;
>  	if (file == NULL) {

It introduces the bug of touching errno. Previous code does it right
because 'goto finish;' can't happen with (f < 0) where errno is restored
later.

The whole errno code is complex here for reading at least.
It microoptimize errno handling by removing unnecessary assignment, but
it does not gain much in reality.

Better change for easy reading will be to set
sverrno = errno;
once right at the function enter and remove it in all other places.

In any case errno touching should be backed out.

-- 
http://ache.vniz.net/


More information about the svn-src-head mailing list