From: Andre Noll Date: Tue, 25 Nov 2008 20:34:57 +0000 (+0100) Subject: para_write: Fix --initial-delay. X-Git-Tag: v0.3.3~21 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=d44f3caed23e1bf981b93eee8188a73fdfdc0175;p=paraslash.git para_write: Fix --initial-delay. --- diff --git a/write.c b/write.c index 78e48dcd..50ed2212 100644 --- a/write.c +++ b/write.c @@ -106,14 +106,19 @@ static void initial_delay_pre_select(struct sched *s, struct task *t) if (!idt->start_time.tv_sec && !idt->start_time.tv_usec) { t->error = -E_NO_DELAY; - return; + goto register_check_wav; } if (tv_diff(now, &idt->start_time, &diff) > 0) { t->error = -E_DELAY_TIMEOUT; - return; + goto register_check_wav; } if (tv_diff(&s->timeout , &diff, NULL) > 0) s->timeout = diff; + return; +register_check_wav: + register_task(&the_check_wav_task.task); + s->timeout.tv_sec = 0; + s->timeout.tv_usec = 1; } INIT_STDERR_LOGGING(conf.loglevel_arg) @@ -210,7 +215,6 @@ int main(int argc, char *argv[]) cwt->input_error = &sit.task.error; sprintf(cwt->task.status, "check wav"); cwt->task.pre_select = check_wav_pre_select; - register_task(&cwt->task); idt->task.pre_select = initial_delay_pre_select; sprintf(idt->task.status, "initial_delay");