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

« back to all changes in this revision

Viewing changes to init/job_process.c

  • Committer: Scott James Remnant
  • Date: 2008-05-06 22:22:58 UTC
  • Revision ID: scott@netsplit.com-20080506222258-zk27a10auwftpgq9
* init/main.c (main): Warn if we can't set the root directory.
* init/job_process.c (job_process_spawn)
(job_process_error_abort): loop on the return of write()
* init/tests/test_job_process.c (child, main): assert getcwd() works
(test_handler): initialise list and entry for gcc's blind spot.
(test_run): initialise ret for gcc's blind spot
* init/tests/test_job.c (test_name): jump through hoops for gcc
(test_change_state): list and entry.
* init/tests/test_event.c (test_finished_handle_jobs, test_finished)
(test_pending_handle_jobs, test_poll, test_pending): initialise to
NULL and buy gcc glasses
* init/tests/test_event_operator.c (test_operator_collect): another
NULL to make gcc happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
444
444
                        /* Write -1 as the pid to the parent followed by
445
445
                         * the error.
446
446
                         */
447
 
                        write (fds[1], &pid, sizeof (pid));
 
447
                        while (write (fds[1], &pid, sizeof (pid)) < 0)
 
448
                                ;
448
449
                        job_process_error_abort (fds[1],
449
450
                                                 JOB_PROCESS_ERROR_FORK, 0);
450
451
                }
451
452
 
452
453
                /* Write the new child pid to the parent */
453
454
                pid = getpid ();
454
 
                write (fds[1], &pid, sizeof (pid));
 
455
                while (write (fds[1], &pid, sizeof (pid)) < 0)
 
456
                        ;
455
457
        }
456
458
 
457
459
        /* Set the standard file descriptors to an output of our chosing;
588
590
        /* Write structure to the pipe; in theory this should never fail, but
589
591
         * if it does, we abort anyway.
590
592
         */
591
 
        write (fd, &wire_err, sizeof (wire_err));
 
593
        while (write (fd, &wire_err, sizeof (wire_err)) < 0)
 
594
                ;
592
595
 
593
596
        abort ();
594
597
}