~ubuntu-branches/ubuntu/vivid/keepalived/vivid

« back to all changes in this revision

Viewing changes to genhash/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-05-12 20:26:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090512202615-k850bw35qpuvpq4p
Tags: 1.1.17-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/rules: DEB_UPDATE_RCD_PARAMS := expicit init start/stop
    parameters (don't stop at 0 and 6)
  - debian/init.d: init script header adapted to stop rule
  - debian/keepalived.postinst: Remove shutdown and reboot links

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Part:        Main entry point.
7
7
 *
8
 
 * Version:     $Id: main.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
 
8
 * Version:     $Id: main.c,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
9
9
 *
10
10
 * Authors:     Alexandre Cassen, <acassen@linux-vs.org>
11
11
 *
19
19
 *              as published by the Free Software Foundation; either version
20
20
 *              2 of the License, or (at your option) any later version.
21
21
 *
22
 
 * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
 
22
 * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
23
23
 */
24
24
 
25
25
#include <signal.h>
34
34
 
35
35
/* Terminate handler */
36
36
void
37
 
sigend(int sig)
 
37
sigend(void *v, int sig)
38
38
{
39
39
        /* register the terminate thread */
40
40
        thread_add_terminate_event(master);
45
45
signal_init(void)
46
46
{
47
47
        signal_handler_init();
48
 
        signal_set(SIGHUP, sigend);
49
 
        signal_set(SIGINT, sigend);
50
 
        signal_set(SIGTERM, sigend);
 
48
        signal_set(SIGHUP, sigend, NULL);
 
49
        signal_set(SIGINT, sigend, NULL);
 
50
        signal_set(SIGTERM, sigend, NULL);
51
51
        signal_ignore(SIGPIPE);
52
52
}
53
53
 
207
207
         * Processing the master thread queues,
208
208
         * return and execute one ready thread.
209
209
         * Run until error, used for debuging only.
 
210
         * Note that not calling launch_scheduler() does
 
211
         * not activate SIGCHLD handling, however, this
 
212
         * is no issue here.
210
213
         */
211
214
        while (thread_fetch(master, &thread_obj))
212
215
                thread_call(&thread_obj);