set errno when fileno is called on a FILE with no underlying fd
authorRich Felker <dalias@aerifal.cx>
Tue, 28 Aug 2018 22:40:15 +0000 (18:40 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 28 Aug 2018 22:41:12 +0000 (18:41 -0400)
commitb39b47bac8ee5505cfc595000a140c35460e1cac
tree4541df8890654a784bdb40b9f5fe94dc028ea2e8
parentbaf95a5aefe885ef8a675759c63d43649d312ec6
set errno when fileno is called on a FILE with no underlying fd

this is a POSIX requirement.

also remove the gratuitous locking shenanigans and simply access f->fd
under control of the lock. there is no advantage to not doing so, and
it made the correctness non-obvious at best.
src/stdio/fileno.c