public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: "Fabio M. Di Nitto" <fabbione@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - notifyd: add const and proper function prototypes Date: Mon, 27 Apr 2009 13:57:00 -0000 [thread overview] Message-ID: <20090427135656.EF3EA120301@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=379a7bd9dbd2d20d4f7de18c095e2c6a7c65b887 Commit: 379a7bd9dbd2d20d4f7de18c095e2c6a7c65b887 Parent: c5a8f2003e7465e37ea70bcae010bdb130b4b81b Author: Fabio M. Di Nitto <fdinitto@redhat.com> AuthorDate: Mon Apr 27 15:56:26 2009 +0200 Committer: Fabio M. Di Nitto <fdinitto@redhat.com> CommitterDate: Mon Apr 27 15:56:26 2009 +0200 notifyd: add const and proper function prototypes Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com> --- cman/notifyd/main.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cman/notifyd/main.c b/cman/notifyd/main.c index da34f5a..d5c90c5 100644 --- a/cman/notifyd/main.c +++ b/cman/notifyd/main.c @@ -32,7 +32,7 @@ int rr = 0; #define MAX_ARGS 128 #endif -static void print_usage() +static void print_usage(void) { printf("Usage:\n\n"); printf("cmannotifyd [options]\n\n"); @@ -212,7 +212,7 @@ static void init_logging(int reconf) logt_conf("cmannotifyd", mode, syslog_facility, syslog_priority, logfile_priority, logfile); } -static void dispatch_notification(char *str, int *quorum) +static void dispatch_notification(const char *str, int *quorum) { char *envp[MAX_ARGS]; char *argv[MAX_ARGS]; @@ -240,7 +240,7 @@ static void dispatch_notification(char *str, int *quorum) envp[envptr--] = NULL; - argv[argvptr++] = "cman_notify"; + argv[argvptr++] = strdup("cman_notify"); argv[argvptr--] = NULL; @@ -271,13 +271,19 @@ out: envptr--; } + while(argvptr >= 0) { + if (argv[argvptr]) + free(argv[argvptr]); + + argvptr--; + } if (err) exit(EXIT_FAILURE); } static void cman_callback(cman_handle_t ch, void *private, int reason, int arg) { - char *str = NULL; + const char *str = NULL; switch (reason) { case CMAN_REASON_TRY_SHUTDOWN: @@ -302,7 +308,7 @@ static void cman_callback(cman_handle_t ch, void *private, int reason, int arg) } } -static void byebye_cman() +static void byebye_cman(void) { if (!cman_handle) return; @@ -356,7 +362,7 @@ out: exit(EXIT_SUCCESS); } -static void loop() +static void loop(void) { int cd_result, se_result; fd_set read_fds;
reply other threads:[~2009-04-27 13:57 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090427135656.EF3EA120301@lists.fedorahosted.org \ --to=fabbione@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).