[systemd-commits] 2 commits - src/libsystemd-bus
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Dec 23 13:07:15 PST 2013
src/libsystemd-bus/bus-control.c | 2 +-
src/libsystemd-bus/sd-event.c | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit d711a957780932a2705d9ae9a1fc1b6fa7200b75
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Dec 23 21:55:27 2013 +0100
bus: fix sender match creation on kdbus
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index a898316..942bc01 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.c
@@ -923,7 +923,7 @@ int bus_add_match_internal_kernel(
if (r < 0)
return r;
- if (r > 0) {
+ if (r == 0) {
sender = c->value_str;
sender_length = strlen(sender);
sz += ALIGN8(offsetof(struct kdbus_item, str) + sender_length + 1);
commit 3022d74ba585f961de7015087cd95673705bee3c
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Dec 23 21:44:20 2013 +0100
sd-event: make sd_event_add_signal() fail with EBUSY if signal is not blocked
diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 0317088..0b7b71d 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -22,6 +22,7 @@
#include <sys/epoll.h>
#include <sys/timerfd.h>
#include <sys/wait.h>
+#include <pthread.h>
#include "sd-id128.h"
#include "sd-daemon.h"
@@ -813,6 +814,7 @@ _public_ int sd_event_add_signal(
sd_event_source **ret) {
sd_event_source *s;
+ sigset_t ss;
int r;
assert_return(e, -EINVAL);
@@ -823,6 +825,13 @@ _public_ int sd_event_add_signal(
assert_return(e->state != SD_EVENT_FINISHED, -ESTALE);
assert_return(!event_pid_changed(e), -ECHILD);
+ r = pthread_sigmask(SIG_SETMASK, NULL, &ss);
+ if (r < 0)
+ return -errno;
+
+ if (!sigismember(&ss, sig))
+ return -EBUSY;
+
if (!e->signal_sources) {
e->signal_sources = new0(sd_event_source*, _NSIG);
if (!e->signal_sources)
More information about the systemd-commits
mailing list