ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/s_bsd_kqueue.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/s_bsd_kqueue.c (file contents):
Revision 6350 by michael, Tue Aug 11 17:53:44 2015 UTC vs.
Revision 6557 by michael, Sat Oct 3 18:18:07 2015 UTC

# Line 52 | Line 52 | init_netio(void)
52  
53    if ((fd = kqueue()) < 0)
54    {
55 <    ilog(LOG_TYPE_IRCD, "init_netio: Couldn't open kqueue fd!");
56 <    exit(115); /* Whee! */
55 >    ilog(LOG_TYPE_IRCD, "init_netio: couldn't open kqueue fd: %s", strerror(errno));
56 >    exit(EXIT_FAILURE); /* Whee! */
57    }
58  
59    fd_open(&kqfd, fd, 0, "kqueue() file descriptor");
# Line 157 | Line 157 | comm_select(void)
157  
158    if (num < 0)
159    {
160 < #ifdef HAVE_USLEEP
161 <    usleep(50000);  /* avoid 99% CPU in comm_select */
162 < #endif
160 >    const struct timespec req = { .tv_sec = 0, .tv_nsec = 50000000 };
161 >    nanosleep(&req, NULL);  /* Avoid 99% CPU in comm_select */
162      return;
163    }
164  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)