From d9952b9054f918fbad48c8298b7721b50e75b732 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Mar 2023 12:57:42 +0100 Subject: [PATCH] CommandLine: hard-code `daemon=false` if ENABLE_DAEMON is not set --- src/CommandLine.cxx | 4 ++++ src/CommandLine.hxx | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index 10f901bb0..d69b564b2 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -352,12 +352,16 @@ ParseCommandLine(int argc, char **argv, CommandLineOptions &options, break; case OPTION_NO_DAEMON: +#ifdef ENABLE_DAEMON options.daemon = false; +#endif break; #ifdef __linux__ case OPTION_SYSTEMD: +#ifdef ENABLE_DAEMON options.daemon = false; +#endif options.systemd = true; break; #endif diff --git a/src/CommandLine.hxx b/src/CommandLine.hxx index 17c10affd..60b4cdc0d 100644 --- a/src/CommandLine.hxx +++ b/src/CommandLine.hxx @@ -20,11 +20,18 @@ #ifndef MPD_COMMAND_LINE_HXX #define MPD_COMMAND_LINE_HXX +#include "config.h" // for ENABLE_DAEMON + struct ConfigData; struct CommandLineOptions { bool kill = false; + +#ifdef ENABLE_DAEMON bool daemon = true; +#else + static constexpr bool daemon = false; +#endif #ifdef __linux__ bool systemd = false;