cluster: STABLE3 - notifyd: add const and proper function prototypes
Fabio M. Di Nitto
fabbione@fedoraproject.org
Mon Apr 27 13:57:00 GMT 2009
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;
More information about the Cluster-cvs
mailing list