chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: when guessing the main PID don't consider processes that aren't our children
[elogind.git]
/
src
/
dbus.c
diff --git
a/src/dbus.c
b/src/dbus.c
index 66076f021cb1c98fdf77551faed7216f57e04d09..d7b80ba01d17c9bbe8d31ad368b179784c349f11 100644
(file)
--- a/
src/dbus.c
+++ b/
src/dbus.c
@@
-982,7
+982,7
@@
fail:
return r;
}
return r;
}
-int bus_init(Manager *m) {
+int bus_init(Manager *m
, bool try_bus_connect
) {
int r;
if (set_ensure_allocated(&m->bus_connections, trivial_hash_func, trivial_compare_func) < 0 ||
int r;
if (set_ensure_allocated(&m->bus_connections, trivial_hash_func, trivial_compare_func) < 0 ||
@@
-998,14
+998,18
@@
int bus_init(Manager *m) {
}
if (m->subscribed_data_slot < 0)
}
if (m->subscribed_data_slot < 0)
- if (!dbus_
pending_call
_allocate_data_slot(&m->subscribed_data_slot)) {
+ if (!dbus_
connection
_allocate_data_slot(&m->subscribed_data_slot)) {
log_error("Not enough memory");
return -ENOMEM;
}
log_error("Not enough memory");
return -ENOMEM;
}
- if ((r = bus_init_system(m)) < 0 ||
- (r = bus_init_api(m)) < 0 ||
- (r = bus_init_private(m)) < 0)
+ if (try_bus_connect) {
+ if ((r = bus_init_system(m)) < 0 ||
+ (r = bus_init_api(m)) < 0)
+ return r;
+ }
+
+ if ((r = bus_init_private(m)) < 0)
return r;
return 0;
return r;
return 0;
@@
-1110,7
+1114,7
@@
void bus_done(Manager *m) {
dbus_pending_call_free_data_slot(&m->name_data_slot);
if (m->subscribed_data_slot >= 0)
dbus_pending_call_free_data_slot(&m->name_data_slot);
if (m->subscribed_data_slot >= 0)
- dbus_
pending_call
_free_data_slot(&m->subscribed_data_slot);
+ dbus_
connection
_free_data_slot(&m->subscribed_data_slot);
}
static void query_pid_pending_cb(DBusPendingCall *pending, void *userdata) {
}
static void query_pid_pending_cb(DBusPendingCall *pending, void *userdata) {