summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-11-23 21:37:58 +0100
committerLennart Poettering <lennart@poettering.net>2012-11-23 21:37:58 +0100
commit36697dc0199e25f09b78090fcf5f1cf8a3648ffd (patch)
tree7caef3bc1761327c366fc4a93a138e53fc692712 /src/core/socket.c
parent8a1175118e7a2e60a6ec42624f915e26e821f4e8 (diff)
timer: implement calendar time events
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 3d5791b114..9b5bcb6e7b 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1146,10 +1146,12 @@ static int socket_coldplug(Unit *u) {
if (s->control_pid <= 0)
return -EBADMSG;
- if ((r = unit_watch_pid(UNIT(s), s->control_pid)) < 0)
+ r = unit_watch_pid(UNIT(s), s->control_pid);
+ if (r < 0)
return r;
- if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
+ r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
+ if (r < 0)
return r;
}
@@ -1181,10 +1183,12 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
assert(c);
assert(_pid);
- if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
+ r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
+ if (r < 0)
goto fail;
- if (!(argv = unit_full_printf_strv(UNIT(s), c->argv))) {
+ argv = unit_full_printf_strv(UNIT(s), c->argv);
+ if (!argv) {
r = -ENOMEM;
goto fail;
}
@@ -1306,7 +1310,8 @@ static void socket_enter_signal(Socket *s, SocketState state, SocketResult f) {
}
if (wait_for_exit) {
- if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
+ r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
+ if (r < 0)
goto fail;
socket_set_state(s, state);