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

« back to all changes in this revision

Viewing changes to compat/sysv/shutdown.c

  • Committer: Scott James Remnant
  • Date: 2007-02-01 18:18:27 UTC
  • Revision ID: scott@netsplit.com-20070201181827-9nomja4tj98ibvef
* compat/sysv/shutdown.c (main): Ensure that signals and timers
are added, even if we run out of memory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
378
378
 
379
379
        /* Catch the usual quit signals */
380
380
        nih_signal_set_handler (SIGINT, nih_signal_handler);
381
 
        nih_signal_add_handler (NULL, SIGINT, cancel_callback, NULL);
 
381
        NIH_MUST (nih_signal_add_handler (NULL, SIGINT,
 
382
                                          cancel_callback, NULL));
382
383
        nih_signal_set_handler (SIGQUIT, nih_signal_handler);
383
 
        nih_signal_add_handler (NULL, SIGQUIT, cancel_callback, NULL);
 
384
        NIH_MUST (nih_signal_add_handler (NULL, SIGQUIT,
 
385
                                          cancel_callback, NULL));
384
386
        nih_signal_set_handler (SIGTERM, nih_signal_handler);
385
 
        nih_signal_add_handler (NULL, SIGTERM, cancel_callback, NULL);
 
387
        NIH_MUST (nih_signal_add_handler (NULL, SIGTERM,
 
388
                                          cancel_callback, NULL));
386
389
 
387
390
        /* Call a timer every minute until we shutdown */
388
 
        nih_timer_add_periodic (NULL, 60,
389
 
                                (NihTimerCb)timer_callback, message);
 
391
        NIH_MUST (nih_timer_add_periodic (NULL, 60,
 
392
                                          (NihTimerCb)timer_callback,
 
393
                                          message));
390
394
 
391
395
        /* Hang around */
392
396
        nih_main_loop ();