3b402966b9
It's strange eating up the errors here, hence don't. Let's leave this to the caller.
29 lines
579 B
C
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();
|
|
}
|