- while ((res = select(max + 1, &in, &out, &except, timeout ? &to : 0)) < 0)
- if (errno != EINTR)
- return -1;
+ int pass = 0;
+ while ((res = select(max + 1, &in, &out, &except,
+ timeout== -1 ? 0 : &to)) < 0)
+ if (errno != EINTR)
+ {
+ yaz_log(YLOG_ERRNO|YLOG_WARN, "select");
+ yaz_log(YLOG_WARN, "errno=%d max=%d timeout=%d",
+ errno, max, timeout);
+ if (++pass > 10)
+ return -1;
+ }
+ yaz_log(m_log, "select returned res=%d", res);