diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c index 180cb7964c..4d6c0cae6c 100644 --- a/src/shared/spawn-polkit-agent.c +++ b/src/shared/spawn-polkit-agent.c @@ -83,3 +83,16 @@ void polkit_agent_close(void) { } #endif + +int polkit_agent_open_if_enabled(BusTransport transport, bool ask_password) { + + /* Open the polkit agent as a child process if necessary */ + + if (transport != BUS_TRANSPORT_LOCAL) + return 0; + + if (!ask_password) + return 0; + + return polkit_agent_open(); +} diff --git a/src/shared/spawn-polkit-agent.h b/src/shared/spawn-polkit-agent.h index 190b970b6f..56b0175944 100644 --- a/src/shared/spawn-polkit-agent.h +++ b/src/shared/spawn-polkit-agent.h @@ -1,22 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once +#include + #include "bus-util.h" int polkit_agent_open(void); void polkit_agent_close(void); -static inline int polkit_agent_open_if_enabled( - BusTransport transport, - bool ask_password) { - - /* Open the polkit agent as a child process if necessary */ - - if (transport != BUS_TRANSPORT_LOCAL) - return 0; - - if (!ask_password) - return 0; - - return polkit_agent_open(); -} +int polkit_agent_open_if_enabled(BusTransport transport, bool ask_password);