~vorlon/ubuntu/raring/upstart/lp.1199778

« back to all changes in this revision

Viewing changes to init/job_process.c

* init/job_process.c (job_process_spawn): Make sure we don't close
our own file descriptor if it already has the right value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
447
447
        /* Move the script fd to special fd 9; the only gotcha is if that
448
448
         * would be our error descriptor, but that's handled above.
449
449
         */
450
 
        if (script_fd != -1) {
 
450
        if ((script_fd != -1) && (script_fd != JOB_PROCESS_SCRIPT_FD))
451
451
                int tmp = dup2 (script_fd, JOB_PROCESS_SCRIPT_FD);
452
452
                if (tmp < 0)
453
453
                        job_process_error_abort (fds[1], JOB_PROCESS_ERROR_DUP, 0);