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