- if (conf.buffer_tree_given) {
- ret = main_btr(&s);
- goto out;
- }
- wng = check_args();
- if (!wng)
- goto out;
- stdin_set_defaults(&sit);
- ret = -ERRNO_TO_PARA_ERROR(EINVAL);
- if (conf.bufsize_arg < 0)
- goto out;
- if (conf.bufsize_arg >= INT_MAX / 1024)
- goto out;
- sit.bufsize = conf.bufsize_arg * 1024;
- sit.buf = para_malloc(sit.bufsize);
-
- wng->bufp = &sit.buf;
- wng->loaded = &sit.loaded;
- wng->input_error = &sit.task.error;
-
- register_task(&sit.task);
-
- cwt->buf = sit.buf;
- cwt->loaded = &sit.loaded;
- cwt->input_error = &sit.task.error;
- sprintf(cwt->task.status, "check wav");
- cwt->task.pre_select = check_wav_pre_select;
-
- idt->task.pre_select = initial_delay_pre_select;
- sprintf(idt->task.status, "initial_delay");
- register_task(&idt->task);
-
- s.default_timeout.tv_sec = 10;
- s.default_timeout.tv_usec = 0;
- ret = schedule(&s);
- wng_close(wng);
-out: