mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
Merge pull request #72 from teg/event-fork-unref
sd-event: don't touch fd's accross forks
This commit is contained in:
commit
72db4d960c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user