]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/spawn-polkit-agent.h
Merge pull request #12109 from poettering/sleep-minifixes
[thirdparty/systemd.git] / src / shared / spawn-polkit-agent.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
05d3a176 2#pragma once
729e3769 3
8a4b13c5
ZJS
4#include "bus-util.h"
5
6bb92a16
LP
6int polkit_agent_open(void);
7void polkit_agent_close(void);
8a4b13c5 8
3b402966 9static inline int polkit_agent_open_if_enabled(
8a4b13c5
ZJS
10 BusTransport transport,
11 bool ask_password) {
12
13 /* Open the polkit agent as a child process if necessary */
14
15 if (transport != BUS_TRANSPORT_LOCAL)
3b402966 16 return 0;
8a4b13c5
ZJS
17
18 if (!ask_password)
3b402966 19 return 0;
8a4b13c5 20
3b402966 21 return polkit_agent_open();
8a4b13c5 22}