Systemd/src/shared/spawn-polkit-agent.h
Zbigniew Jędrzejewski-Szmek 8a4b13c5cb treewide: unify identical definitions of polkit_agent_open_if_enabled() (#7187)
Follows the same pattern as pager_open() now.
2017-10-30 09:57:53 +01:00

41 lines
1.1 KiB
C

#pragma once
/***
This file is part of systemd.
Copyright 2012 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "bus-util.h"
int polkit_agent_open(void);
void polkit_agent_close(void);
static inline void 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;
if (!ask_password)
return;
polkit_agent_open();
}