diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-06-21 21:19:28 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-06-22 13:23:03 +0200 |
commit | 6f3cd63551db013e3cf5dfcebc41115322d5cfe9 (patch) | |
tree | 0dc6d844cc137cb3e665f79ac78ead4db12bd697 /daemons/cmirrord/cluster.c | |
parent | da42ee3a1f0280742e87a96f5d0694fb869a23e0 (diff) | |
download | lvm2-6f3cd63551db013e3cf5dfcebc41115322d5cfe9.tar.gz lvm2-6f3cd63551db013e3cf5dfcebc41115322d5cfe9.tar.xz lvm2-6f3cd63551db013e3cf5dfcebc41115322d5cfe9.zip |
cleanup: replace memset with struct initilization
Simplifies the code, properly detects too long socket paths,
drops unused parameter.
Diffstat (limited to 'daemons/cmirrord/cluster.c')
-rw-r--r-- | daemons/cmirrord/cluster.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/daemons/cmirrord/cluster.c b/daemons/cmirrord/cluster.c index 9fbf8007..70c76c3a 100644 --- a/daemons/cmirrord/cluster.c +++ b/daemons/cmirrord/cluster.c @@ -1249,7 +1249,7 @@ static void cpg_join_callback(struct clog_cpg *match, uint32_t my_pid = (uint32_t)getpid(); uint32_t lowest = match->lowest_id; struct clog_request *rq; - char dbuf[32]; + char dbuf[32] = { 0 }; /* Assign my_cluster_id */ if ((my_cluster_id == 0xDEAD) && (joined->pid == my_pid)) @@ -1265,7 +1265,6 @@ static void cpg_join_callback(struct clog_cpg *match, if (joined->nodeid == my_cluster_id) goto out; - memset(dbuf, 0, sizeof(dbuf)); for (i = 0; i < member_list_entries - 1; i++) sprintf(dbuf+strlen(dbuf), "%u-", member_list[i].nodeid); sprintf(dbuf+strlen(dbuf), "(%u)", joined->nodeid); |