~tuomotanskanen/upstart/fix-for-918570

« back to all changes in this revision

Viewing changes to init/job_process.c

  • Committer: James Hunt
  • Date: 2011-12-22 16:28:33 UTC
  • Revision ID: james.hunt@ubuntu.com-20111222162833-usfes3opguu8jn22
init/job_process.c: job_process_spawn():
- Set child handler to default rather than explicit ignore
  to avoid test failures in environments that disallow
  ignoring SIGCHLD.

Show diffs side-by-side

added added

removed removed

Lines of Context:
544
544
                /* Child is the slave, so won't need this */
545
545
                nih_io_set_cloexec (pty_master);
546
546
 
547
 
                /* Save old handler as grantpt disallows a child handler
548
 
                 * to be in effect.
 
547
                /* Temporarily disable child handler as grantpt(3) disallows one
 
548
                 * being in effect when called.
549
549
                 */
550
 
                ignore.sa_handler = SIG_IGN;
 
550
                ignore.sa_handler = SIG_DFL;
 
551
                ignore.sa_flags = 0;
551
552
                sigemptyset (&ignore.sa_mask);
552
553
 
553
554
                if (sigaction (SIGCHLD, &ignore, &act) < 0) {
558
559
                        job_process_error_abort (fds[1], JOB_PROCESS_ERROR_OPENPT_MASTER, 0);
559
560
                }
560
561
 
561
 
                /* Restore handler */
 
562
                /* Restore child handler */
562
563
                if (sigaction (SIGCHLD, &act, NULL) < 0) {
563
564
                        job_process_error_abort (fds[1], JOB_PROCESS_ERROR_OPENPT_MASTER, 0);
564
565
                }