As Chris Torek remarked, to avoid a possible race in applications that use SIGCLD catchers, the resetting of SIGCLD to SIGDFL should be done before the fork().