]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/spawn-polkit-agent.c
polkit-agent: don't use an inline function
[thirdparty/systemd.git] / src / shared / spawn-polkit-agent.c
index 180cb7964cf3e68998d8c6003fef448634e31dfb..4d6c0cae6caf1a8f359b4cc6cdc457f98eb3c1f2 100644 (file)
@@ -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();
+}