chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: don't do runaway fork()s if we hit a segfault from our segfault handler
[elogind.git]
/
src
/
core
/
dbus-job.c
diff --git
a/src/core/dbus-job.c
b/src/core/dbus-job.c
index 20c2a623380cf2aba17e3ef20cda10ee4cfc2a05..98ccfa62ec60da00c6a92b1715b418d46282c304 100644
(file)
--- a/
src/core/dbus-job.c
+++ b/
src/core/dbus-job.c
@@
-116,7
+116,7
@@
static DBusHandlerResult bus_job_message_dispatch(Job *j, DBusConnection *connec
return bus_default_message_handler(connection, message, INTROSPECTION, INTERFACES_LIST, bps);
}
return bus_default_message_handler(connection, message, INTROSPECTION, INTERFACES_LIST, bps);
}
- if (!
dbus_connection_send(connection, reply, NULL
))
+ if (!
bus_maybe_send_reply(connection, message, reply
))
return DBUS_HANDLER_RESULT_NEED_MEMORY;
return DBUS_HANDLER_RESULT_HANDLED;
return DBUS_HANDLER_RESULT_NEED_MEMORY;
return DBUS_HANDLER_RESULT_HANDLED;
@@
-185,7
+185,7
@@
static DBusHandlerResult bus_job_message_handler(DBusConnection *connection, DBu
free(introspection);
free(introspection);
- if (!
dbus_connection_send(connection, reply, NULL
))
+ if (!
bus_maybe_send_reply(connection, message, reply
))
goto oom;
return DBUS_HANDLER_RESULT_HANDLED;
goto oom;
return DBUS_HANDLER_RESULT_HANDLED;
@@
-218,7
+218,7
@@
const DBusObjectPathVTable bus_job_vtable = {
};
static int job_send_message(Job *j, DBusMessage* (*new_message)(Job *j)) {
};
static int job_send_message(Job *j, DBusMessage* (*new_message)(Job *j)) {
- DBusMessage *m = NULL;
+
_cleanup_dbus_message_unref_
DBusMessage *m = NULL;
int r;
assert(j);
int r;
assert(j);
@@
-227,9
+227,9
@@
static int job_send_message(Job *j, DBusMessage* (*new_message)(Job *j)) {
if (bus_has_subscriber(j->manager) || j->forgot_bus_clients) {
m = new_message(j);
if (!m)
if (bus_has_subscriber(j->manager) || j->forgot_bus_clients) {
m = new_message(j);
if (!m)
- goto oom;
+ return -ENOMEM;
+
r = bus_broadcast(j->manager, m);
r = bus_broadcast(j->manager, m);
- dbus_message_unref(m);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-238,18
+238,19
@@
static int job_send_message(Job *j, DBusMessage* (*new_message)(Job *j)) {
* to the client(s) which created the job */
JobBusClient *cl;
assert(j->bus_client_list);
* to the client(s) which created the job */
JobBusClient *cl;
assert(j->bus_client_list);
+
LIST_FOREACH(client, cl, j->bus_client_list) {
assert(cl->bus);
m = new_message(j);
if (!m)
LIST_FOREACH(client, cl, j->bus_client_list) {
assert(cl->bus);
m = new_message(j);
if (!m)
-
goto oom
;
+
return -ENOMEM
;
if (!dbus_message_set_destination(m, cl->name))
if (!dbus_message_set_destination(m, cl->name))
-
goto oom
;
+
return -ENOMEM
;
if (!dbus_connection_send(cl->bus, m, NULL))
if (!dbus_connection_send(cl->bus, m, NULL))
-
goto oom
;
+
return -ENOMEM
;
dbus_message_unref(m);
m = NULL;
dbus_message_unref(m);
m = NULL;
@@
-257,10
+258,6
@@
static int job_send_message(Job *j, DBusMessage* (*new_message)(Job *j)) {
}
return 0;
}
return 0;
-oom:
- if (m)
- dbus_message_unref(m);
- return -ENOMEM;
}
static DBusMessage* new_change_signal_message(Job *j) {
}
static DBusMessage* new_change_signal_message(Job *j) {