chiark / gitweb /
cf4a473606cc286984659d592b21f67459d3da87
[elogind.git] / src / shared / spawn-polkit-agent.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   Copyright 2012 Lennart Poettering
6 ***/
7
8 #include "bus-util.h"
9
10 int polkit_agent_open(void);
11 void polkit_agent_close(void);
12
13 static inline int polkit_agent_open_if_enabled(
14                 BusTransport transport,
15                 bool ask_password) {
16
17         /* Open the polkit agent as a child process if necessary */
18
19         if (transport != BUS_TRANSPORT_LOCAL)
20                 return 0;
21
22         if (!ask_password)
23                 return 0;
24
25         return polkit_agent_open();
26 }