diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-25 22:20:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-25 22:20:57 +0100 |
commit | e14c280244fc07a19d0acab2f08c9f783458af34 (patch) | |
tree | 9ec14c0527b1e0c2f6451b6e5bf9487bb6c6b529 | |
parent | eeaedb7c26375352c32ec290cd716f2ff2dbe61a (diff) |
service: fix handling of PID file inotify events
-rw-r--r-- | src/core/service.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c index e408338b10..28b1465c19 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -2916,7 +2916,12 @@ static int service_demand_pid_file(Service *s) { } static int service_dispatch_io(sd_event_source *source, int fd, uint32_t events, void *userdata) { - Service *s = SERVICE(userdata); + PathSpec *p = userdata; + Service *s; + + assert(p); + + s = SERVICE(p->unit); assert(s); assert(fd >= 0); @@ -2926,7 +2931,7 @@ static int service_dispatch_io(sd_event_source *source, int fd, uint32_t events, log_debug_unit(UNIT(s)->id, "inotify event for %s", UNIT(s)->id); - if (path_spec_fd_event(s->pid_file_pathspec, events) < 0) + if (path_spec_fd_event(p, events) < 0) goto fail; if (service_retry_pid_file(s) == 0) |