summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-06-04 19:21:17 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-06-04 19:21:17 +0200
commit72db4d960c187d69d785b25bcf7b45d86d687f3b (patch)
tree5fdbd64bdf735476e75e256e1914cfb7c177e207 /src
parent5c9e74f738da3b94f7814e1c19a5aafcaff036f4 (diff)
parentf68067348f58cd08d8f4f5325ce22f9a9d2c2140 (diff)
Merge pull request #72 from teg/event-fork-unref
sd-event: don't touch fd's accross forks
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-event/sd-event.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index cc8bc50c04..2b8d1b87ed 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -474,6 +474,9 @@ static int source_io_unregister(sd_event_source *s) {
assert(s);
assert(s->type == SOURCE_IO);
+ if (event_pid_changed(s->event))
+ return 0;
+
if (!s->io.registered)
return 0;
@@ -604,6 +607,9 @@ static int event_update_signal_fd(sd_event *e) {
assert(e);
+ if (event_pid_changed(e))
+ return 0;
+
add_to_epoll = e->signal_fd < 0;
r = signalfd(e->signal_fd, &e->sigset, SFD_NONBLOCK|SFD_CLOEXEC);