#include "strv.h"
#include "cgroup.h"
#include "mkdir.h"
+#include "missing.h"
#include "dbus-unit.h"
#include "dbus-job.h"
#include "dbus-manager.h"
log_debug("System D-Bus connection terminated.");
bus_done_system(m);
- } else if (m->running_as != MANAGER_SYSTEM &&
+ } else if (m->running_as != SYSTEMD_SYSTEM &&
dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) {
const char *cgroup;
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected"))
shutdown_connection(m, connection);
- else if (m->running_as == MANAGER_SYSTEM &&
+ else if (m->running_as == SYSTEMD_SYSTEM &&
dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) {
const char *cgroup;
if (!dbus_connection_add_filter(m->system_bus, system_bus_message_filter, m, NULL))
return log_oom();
- if (m->running_as != MANAGER_SYSTEM) {
+ if (m->running_as != SYSTEMD_SYSTEM) {
DBusError error;
dbus_error_init(&error);
if (r < 0)
return r;
- if (m->running_as == MANAGER_USER) {
+ if (m->running_as == SYSTEMD_USER) {
char *id;
log_debug("Successfully connected to API D-Bus bus %s as %s",
strnull((id = dbus_connection_get_server_id(m->api_bus))),
if (conn == &m->system_bus) {
r = init_registered_system_bus(m);
- if (r == 0 && m->running_as == MANAGER_SYSTEM)
+ if (r == 0 && m->running_as == SYSTEMD_SYSTEM)
r = init_registered_api_bus(m);
} else
r = init_registered_api_bus(m);
switch (type) {
case DBUS_BUS_SYSTEM:
- address = __secure_getenv("DBUS_SYSTEM_BUS_ADDRESS");
+ address = secure_getenv("DBUS_SYSTEM_BUS_ADDRESS");
if (!address || !address[0])
address = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS;
break;
case DBUS_BUS_SESSION:
- address = __secure_getenv("DBUS_SESSION_BUS_ADDRESS");
+ address = secure_getenv("DBUS_SESSION_BUS_ADDRESS");
if (!address || !address[0])
address = DBUS_SESSION_BUS_DEFAULT_ADDRESS;
break;
if (m->api_bus)
return 0;
- if (m->running_as == MANAGER_SYSTEM) {
+ if (m->running_as == SYSTEMD_SYSTEM) {
m->api_bus = m->system_bus;
/* In this mode there is no distinct connection to the API bus,
* the API is published on the system bus.
if (m->private_bus)
return 0;
- if (m->running_as == MANAGER_SYSTEM) {
+ if (m->running_as == SYSTEMD_SYSTEM) {
/* We want the private bus only when running as init */
if (getpid() != 1)
const char *e;
char *p;
- e = __secure_getenv("XDG_RUNTIME_DIR");
+ e = secure_getenv("XDG_RUNTIME_DIR");
if (!e)
return 0;
dbus_connection_set_dispatch_status_function(c, NULL, NULL, NULL);
/* system manager cannot afford to block on DBus */
- if (m->running_as != MANAGER_SYSTEM)
+ if (m->running_as != SYSTEMD_SYSTEM)
dbus_connection_flush(c);
dbus_connection_close(c);
dbus_connection_unref(c);
if (!m->api_bus)
return;
- if (m->running_as == MANAGER_USER)
+ if (m->running_as == SYSTEMD_USER)
shutdown_connection(m, m->api_bus);
m->api_bus = NULL;
if (!m->system_bus)
return;
- if (m->running_as == MANAGER_SYSTEM)
+ if (m->running_as == SYSTEMD_SYSTEM)
bus_done_api(m);
shutdown_connection(m, m->system_bus);
assert(message);
SET_FOREACH(c, m->bus_connections_for_dispatch, i)
- if (c != m->system_bus || m->running_as == MANAGER_SYSTEM)
+ if (c != m->system_bus || m->running_as == SYSTEMD_SYSTEM)
oom = !dbus_connection_send(c, message, NULL);
SET_FOREACH(c, m->bus_connections, i)
- if (c != m->system_bus || m->running_as == MANAGER_SYSTEM)
+ if (c != m->system_bus || m->running_as == SYSTEMD_SYSTEM)
oom = !dbus_connection_send(c, message, NULL);
return oom ? -ENOMEM : 0;