parlib: Fix devalarms on forks without exec
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 28 Sep 2017 14:54:06 +0000 (10:54 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 29 Sep 2017 14:00:03 +0000 (10:00 -0400)
commit220dd0bb7b22db6d488396b1b109fdf88edc2d42
treef19d37990960cfefa1db984bd48e04c258fccac8
parent48cde810182208ba183444bbcf06edbdee20eac7
parlib: Fix devalarms on forks without exec

After the fork, the child would close the alarm FDs, which are the
parent's alarm FDs.  However, it wouldn't get its own alarms until exec,
during the ctor.  For processes that forked but never execed, they
wouldn't have the alarm service available.

I noticed this when the process's child was trying to close those -42
FDs when the process forked. (e.g. db -> db -> sh).

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/alarm.c