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"); |
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 |
|
|