tv.tv_sec = io_timeout;
tv.tv_usec = 0;
- if (select(fd+1, &fds, NULL, NULL, &tv) != 1) {
+ if (select(fd+1, &fds, NULL, NULL,
+ io_timeout?&tv:NULL) != 1) {
check_timeout();
}
}
#if HAVE_VSNPRINTF
len = vsnprintf(buf, sizeof(buf)-1, format, ap);
#else
- len = vsprintf(buf, format, ap);
+ vsprintf(buf, format, ap);
+ len = strlen(buf);
#endif
va_end(ap);