We need to call it anyway, so the else branch is redundant here.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
It was either this or revert the order of the conditions so that the else
branch/block is actually the bigger one, complying with our guidelines.
src/locking/lock_daemon.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 0d5e999ef..6751b57bc 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -1325,10 +1325,11 @@ int main(int argc, char **argv) {
ret = VIR_LOCK_DAEMON_ERR_NETWORK;
goto cleanup;
}
- } else if (rv == 1) {
- srv = virNetDaemonGetServer(lockDaemon->dmn, "virtlockd");
+ virObjectUnref(srv);
}
+ srv = virNetDaemonGetServer(lockDaemon->dmn, "virtlockd");
+
if (timeout != -1) {
VIR_DEBUG("Registering shutdown timeout %d", timeout);
virNetDaemonAutoShutdown(lockDaemon->dmn,
--
2.13.6