prevent fork's errno from being clobbered by atfork handlers
authorBobby Bingham <koorogi@koorogi.info>
Sat, 11 Nov 2017 00:15:43 +0000 (18:15 -0600)
committerRich Felker <dalias@aerifal.cx>
Sat, 11 Nov 2017 00:27:57 +0000 (19:27 -0500)
commitc21051e90cd27a0b26be0ac66950b7396a156ba1
treeaa4367f565765f4e8b155e19b320fac6b68eaa40
parenta39f20bf9f8e59573a479bff23df345b2b4d2345
prevent fork's errno from being clobbered by atfork handlers

If the syscall fails, errno must be set correctly for the caller.
There's no guarantee that the handlers registered with pthread_atfork
won't clobber errno, so we need to ensure it gets set after they are
called.
src/process/fork.c