lib:util: Move variable initialization out of conditional compilation block
authorSamuel Cabrero <scabrero@suse.de>
Thu, 25 Feb 2021 16:13:46 +0000 (17:13 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 1 Mar 2021 03:50:35 +0000 (03:50 +0000)
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/become_daemon.c

index 89991b7981cc50ba705fa9e83a1d18f49521ac6b..047c54ba49d2e5f34bbd690d29938eca3342d84a 100644 (file)
@@ -108,11 +108,11 @@ void become_daemon(bool do_fork, bool no_session, bool log_stdout)
 
 void exit_daemon(const char *msg, int error)
 {
-#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
        if (msg == NULL) {
                msg = strerror(error);
        }
 
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
        sd_notifyf(0, "STATUS=daemon failed to start: %s\n"
                                  "ERRNO=%i",
                                  msg,