~ubuntu-branches/ubuntu/trusty/keepalived/trusty

« back to all changes in this revision

Viewing changes to keepalived/vrrp/vrrp_notify.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2005-04-29 23:22:40 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050429232240-a8m3jtpi3cvuyyy2
Tags: 1.1.11-3
Added a warning about sarge kernels to README.Debian and 
the package description 

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Part:        VRRP state transition notification scripts handling.
7
7
 *
8
 
 * Version:     $Id: vrrp_notify.c,v 1.1.7 2004/04/04 23:28:05 acassen Exp $
 
8
 * Version:     $Id: vrrp_notify.c,v 1.1.11 2005/03/01 01:22:13 acassen Exp $
9
9
 *
10
10
 * Author:      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-2004 Alexandre Cassen, <acassen@linux-vs.org>
 
22
 * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
23
23
 */
24
24
 
25
25
/* system include */
75
75
{
76
76
        char *cp = cmdline;
77
77
        char *script;
78
 
        int strlen;
 
78
        int str_len;
79
79
 
80
80
        if (!cmdline)
81
81
                return NULL;
82
82
        while (!isspace((int) *cp) && *cp != '\0')
83
83
                cp++;
84
 
        strlen = cp - cmdline;
85
 
        script = MALLOC(strlen + 1);
86
 
        memcpy(script, cmdline, strlen);
87
 
        *(script + strlen) = '\0';
 
84
        str_len = cp - cmdline;
 
85
        script = MALLOC(str_len + 1);
 
86
        memcpy(script, cmdline, str_len);
 
87
        *(script + str_len) = '\0';
88
88
 
89
89
        return script;
90
90
}
105
105
static int
106
106
script_open(char *script)
107
107
{
108
 
        return script_open_litteral(notify_script_name(script));
 
108
        char *name = notify_script_name(script);
 
109
        int ret = name ? script_open_litteral(name) : 0;
 
110
        if (name)
 
111
                FREE(name);
 
112
        return ret;
109
113
}
110
114
 
111
115
static int