- ret = -1; /* just one at once should select... */
- begin_critical_section(S_SELECT);
-
- FD_ZERO(&tempset);
- if (msock > 0) FD_SET(msock, &tempset);
- tv.tv_sec = 0;
- tv.tv_usec = 10000;
- if (msock > 0) ret = select(msock+1, &tempset, NULL, NULL, &tv);
- end_critical_section(S_SELECT);
- if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN))
- {/* EINTR and EAGAIN are thrown but not of interest. */
- lprintf(2, "accept() failed:%d %s\n",
- errno, strerror(errno));
- }
- else if ((ret > 0) && (msock > 0) && FD_ISSET(msock, &tempset))
- {/* Successfully selected, and still not shutting down? Accept! */
- ssock = accept(msock, NULL, 0);
- }
-
+ ssock = accept(msock, NULL, 0);
+ lprintf(9, "\033[3%dmthread %u woke up, accept() returned %d %s\033[0m\n",
+ ((pthread_self() % 6) + 1),
+ pthread_self(),
+ ssock,
+ ((ssock >= 0) ? "" : strerror(errno))
+ );