From de0ae6a18f2a7c3c4057b64454da7da16324a912 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 5 Jan 2011 12:59:46 +0000 Subject: [PATCH] Fail deamonization if lvmcache_init fail FIXME Add proper cleanup --- WHATS_NEW | 1 + tools/polldaemon.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 562627c51..3dc914121 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.80 - ==================================== + Fail poll daemon creation when lvmcache_init() fails. Return defined value for errors in _copy_percent() and _snap_percent(). Correct return code of cmirrord when issuing 'start' when already running. Fix wrongly paired unlocking of global lock in pvchange. (2.02.66) diff --git a/tools/polldaemon.c b/tools/polldaemon.c index 50579baba..4da27fed7 100644 --- a/tools/polldaemon.c +++ b/tools/polldaemon.c @@ -64,7 +64,9 @@ static int _become_daemon(struct cmd_context *cmd) strncpy(*cmd->argv, "(lvm2)", strlen(*cmd->argv)); reset_locking(); - lvmcache_init(); + if (!lvmcache_init()) + /* FIXME Clean up properly here */ + _exit(ECMD_FAILED); dev_close_all(); return 1;