1 |
|
/* |
2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
|
* |
4 |
< |
* Copyright (c) 2001-2014 ircd-hybrid development team |
4 |
> |
* Copyright (c) 2001-2016 ircd-hybrid development team |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
15 |
|
* |
16 |
|
* You should have received a copy of the GNU General Public License |
17 |
|
* along with this program; if not, write to the Free Software |
18 |
< |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
18 |
> |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
19 |
|
* USA |
20 |
|
*/ |
21 |
|
|
57 |
|
|
58 |
|
if ((fd = open("/dev/poll", O_RDWR)) < 0) |
59 |
|
{ |
60 |
< |
ilog(LOG_TYPE_IRCD, "init_netio: Couldn't open /dev/poll - %d: %s", |
61 |
< |
errno, strerror(errno)); |
62 |
< |
exit(115); /* Whee! */ |
60 |
> |
ilog(LOG_TYPE_IRCD, "init_netio: couldn't open /dev/poll: %s", |
61 |
> |
strerror(errno)); |
62 |
> |
exit(EXIT_FAILURE); /* Whee! */ |
63 |
|
} |
64 |
|
|
65 |
|
fd_open(&dpfd, fd, 0, "/dev/poll file descriptor"); |
155 |
|
|
156 |
|
if (num < 0) |
157 |
|
{ |
158 |
< |
#ifdef HAVE_USLEEP |
159 |
< |
usleep(50000); /* avoid 99% CPU in comm_select */ |
160 |
< |
#endif |
158 |
> |
const struct timespec req = { .tv_sec = 0, .tv_nsec = 50000000 }; |
159 |
> |
nanosleep(&req, NULL); /* Avoid 99% CPU in comm_select */ |
160 |
|
return; |
161 |
|
} |
162 |
|
|