struct tvec_timeoutctx *tc = ctx;
if (STRCMP(var, ==, "@timeout")) {
- if (tc->f&TVTF_SETTMO) return (tvec_dupreg(tv, var));
+ if (tc->f&TVTF_SETTMO) return (tvec_dupregerr(tv, var));
tc->t = rv->f; tc->f |= TVTF_SETTMO;
} else if (STRCMP(var, ==, "@timer")) {
- if (tc->f&TVTF_SETTMR) return (tvec_dupreg(tv, var));
+ if (tc->f&TVTF_SETTMR) return (tvec_dupregerr(tv, var));
tc->timer = rv->i; tc->f |= TVTF_SETTMR;
} else assert(!"unknown var");
return (0);
static const struct tvec_vardef timeout_var =
{ sizeof(struct tvec_reg), setvar,
- { "@timeout", -1, &tvty_duration, 0 } };
+ { "@timeout", &tvty_duration, -1, 0 } };
static const struct tvec_iassoc timer_assocs[] = {
{ "REAL", ITIMER_REAL },
{ "interval-timer", timer_assocs, &tvrange_int };
static const struct tvec_vardef timer_var =
{ sizeof(struct tvec_reg), setvar,
- { "@timer", -1, &tvty_ienum, 0, { &timer_enum } } };
+ { "@timer", &tvty_ienum, -1, 0, { &timer_enum } } };
const struct tvec_vardef *tvec_timeoutfindvar
(struct tvec_state *tv, const char *var, void **ctx_out, void *ctx)
tvec_skip(tv, "failed to set interval timer: %s", strerror(errno));
else {
if (subenv && subenv->run) subenv->run(tv, fn, tc->subctx);
- else fn(tv->in, tv->out, tc->subctx);
+ else { fn(tv->in, tv->out, tc->subctx); tvec_check(tv, 0); }
itv.it_interval.tv_sec = 0; itv.it_interval.tv_usec = 0;
itv.it_value.tv_sec = 0; itv.it_value.tv_usec = 0;