Systemd/src/shared/spawn-polkit-agent.h
Lennart Poettering 3b402966b9 polkit: normalize exit values of polkit_agent_open_if_enabled()
It's strange eating up the errors here, hence don't. Let's leave this
to the caller.
2018-04-17 19:51:43 +02:00

29 lines
579 B
C

/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
/***
This file is part of systemd.
Copyright 2012 Lennart Poettering
***/
#include "bus-util.h"
int polkit_agent_open(void);
void polkit_agent_close(void);
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 0;
if (!ask_password)
return 0;
return polkit_agent_open();
}