summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-11-22 00:38:55 +0100
committerLennart Poettering <lennart@poettering.net>2012-11-22 00:45:22 +0100
commit68b29a9fca915c83b9192790ec61189430cd5de6 (patch)
tree6f1d6f6e049aab2194ac66398bc304068daa3694 /src/core/manager.c
parent0b2665c33de93d576047bf55ecff9e1435033f54 (diff)
manager: introduce watch_init() initializer for watches
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index f932c79a1b..72ce2f2595 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1363,7 +1363,8 @@ static int process_event(Manager *m, struct epoll_event *ev) {
ssize_t k;
/* Some timer event, to be dispatched to the units */
- if ((k = read(w->fd, &v, sizeof(v))) != sizeof(v)) {
+ k = read(w->fd, &v, sizeof(v));
+ if (k != sizeof(v)) {
if (k < 0 && (errno == EINTR || errno == EAGAIN))
break;
@@ -2307,3 +2308,10 @@ bool manager_get_show_status(Manager *m) {
return plymouth_running();
}
+
+void watch_init(Watch *w) {
+ assert(w);
+
+ w->type = WATCH_INVALID;
+ w->fd = -1;
+}