diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-01-08 16:52:59 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-01-08 16:52:59 +0000 |
commit | a46321eba2630d0d3d3bc2ac16ece3dd6507f8a8 (patch) | |
tree | da7e7e67145ae6b9498ff64cd1ea098c33627063 /usr.sbin/hoststated/hce.c | |
parent | 40f355c442fea645d90f475ab659d79d5ef06efb (diff) |
the timeout values are not allowed to exceed the global interval (i
figured this out while testing hostated against a stottering spamd
where the send/expect timeout needs be > 10 seconds). also use another
struct timeval to store the interval for easier handling in the code.
ok Pierre-Yves Ritschard (pyr at spootnik dot org)
Diffstat (limited to 'usr.sbin/hoststated/hce.c')
-rw-r--r-- | usr.sbin/hoststated/hce.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/hoststated/hce.c b/usr.sbin/hoststated/hce.c index 21cfe8a91aa..538783830d9 100644 --- a/usr.sbin/hoststated/hce.c +++ b/usr.sbin/hoststated/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.5 2007/01/08 13:37:26 reyk Exp $ */ +/* $OpenBSD: hce.c,v 1.6 2007/01/08 16:52:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -139,8 +139,7 @@ hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], event_add(&ibuf_main->ev, NULL); evtimer_set(&env->ev, hce_launch_checks, NULL); - tv.tv_sec = env->interval; - tv.tv_usec = 0; + bcopy(&env->interval, &tv, sizeof(tv)); evtimer_add(&env->ev, &tv); hce_launch_checks(0, 0, NULL); @@ -232,8 +231,7 @@ hce_notify_done(struct host *host, const char *msg) TAILQ_FOREACH(host, &table->hosts, entry) host->flags &= ~F_CHECK_DONE; } - tv.tv_sec = env->interval; - tv.tv_usec = 0; + bcopy(&env->interval, &tv, sizeof(tv)); evtimer_add(&env->ev, &tv); bzero(&st, sizeof(st)); } |