polkit: normalize exit values of polkit_agent_open_if_enabled()
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Apr 2018 19:37:12 +0000 (21:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Apr 2018 17:51:43 +0000 (19:51 +0200)
It's strange eating up the errors here, hence don't. Let's leave this
to the caller.

src/shared/spawn-polkit-agent.h

index ea72c12..c4316ea 100644 (file)
 int polkit_agent_open(void);
 void polkit_agent_close(void);
 
-static inline void polkit_agent_open_if_enabled(
+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;
+                return 0;
 
         if (!ask_password)
-                return;
+                return 0;
 
-        polkit_agent_open();
+        return polkit_agent_open();
 }