diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-27 11:26:25 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-27 11:26:25 +0000 |
commit | 75f8f3ce8b4b2016c477f0f77c90a44597fc9538 (patch) | |
tree | 35712516186067c42bd15cb1277dc60908bea413 /daemons/clvmd/clvmd.c | |
parent | 530efdb5252903875da2248776e24d1bfd90538f (diff) | |
download | lvm2-75f8f3ce8b4b2016c477f0f77c90a44597fc9538.tar.gz lvm2-75f8f3ce8b4b2016c477f0f77c90a44597fc9538.tar.xz lvm2-75f8f3ce8b4b2016c477f0f77c90a44597fc9538.zip |
Nicer cleanup of excl_uuid hash
Since it on exit path, it's not a big difference,
but makes less noise in analyzer and valgrind.
Diffstat (limited to 'daemons/clvmd/clvmd.c')
-rw-r--r-- | daemons/clvmd/clvmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index cb38fc1d..ea5380b1 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -345,6 +345,7 @@ int main(int argc, char *argv[]) debug_t debug_arg = DEBUG_OFF; int clusterwide_opt = 0; mode_t old_mask; + int ret = 1; struct option longopts[] = { { "help", 0, 0, 'h' }, @@ -372,7 +373,8 @@ int main(int argc, char *argv[]) case 'S': check_permissions(); - return restart_clvmd(clusterwide_opt)==1?0:1; + ret = (restart_clvmd(clusterwide_opt) == 1) ? 0 : 1; + goto out; case 'C': clusterwide_opt = 1; @@ -402,7 +404,7 @@ int main(int argc, char *argv[]) case 'E': if (!dm_hash_insert(lvm_params.excl_uuid, optarg, optarg)) { fprintf(stderr, "Failed to allocate hash entry\n"); - return 1; + goto out; } break; case 'T': @@ -624,9 +626,11 @@ int main(int argc, char *argv[]) free(delfd); } + ret = 0; +out: dm_hash_destroy(lvm_params.excl_uuid); - return 0; + return ret; } /* Called when the cluster layer has completed initialisation. |