/* threading fds if we have them */
if (base->th_notify_fd[0] != -1) {
event_del(&base->th_notify);
- close(base->th_notify_fd[0]);
- close(base->th_notify_fd[1]);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
}
if (base->th_base_lock != NULL)
/* if we are not in the right thread, we need to wake up the loop */
if (res != -1 && !EVTHREAD_IN_THREAD(base))
- write(base->th_notify_fd[1], "", 1);
+ send(base->th_notify_fd[1], "", 1, 0);
return (res);
}
int buf[128];
/* we draining the socket */
- while (read(fd, buf, sizeof(buf)) != -1)
+ while (recv(fd, buf, sizeof(buf), 0) != -1)
;
event_add(&base->th_notify, NULL);