|
Lines 228-254
ntp_main(int pipe_prnt[2], struct ntpd_c
Link Here
|
| 228 |
ntp_quit = 1; |
228 |
ntp_quit = 1; |
| 229 |
} |
229 |
} |
| 230 |
|
230 |
|
| 231 |
if (nfds > 0 && (pfd[PFD_PIPE_MAIN].revents & POLLOUT)) |
231 |
if (nfds > 0 && (pfd[PFD_PIPE_MAIN].revents & (POLLOUT|POLLERR))) |
| 232 |
if (msgbuf_write(&ibuf_main->w) < 0) { |
232 |
if (msgbuf_write(&ibuf_main->w) < 0) { |
| 233 |
log_warn("pipe write error (to parent)"); |
233 |
log_warn("pipe write error (to parent)"); |
| 234 |
ntp_quit = 1; |
234 |
ntp_quit = 1; |
| 235 |
} |
235 |
} |
| 236 |
|
236 |
|
| 237 |
if (nfds > 0 && pfd[PFD_PIPE_MAIN].revents & POLLIN) { |
237 |
if (nfds > 0 && pfd[PFD_PIPE_MAIN].revents & (POLLIN|POLLERR)) { |
| 238 |
nfds--; |
238 |
nfds--; |
| 239 |
if (ntp_dispatch_imsg() == -1) |
239 |
if (ntp_dispatch_imsg() == -1) |
| 240 |
ntp_quit = 1; |
240 |
ntp_quit = 1; |
| 241 |
} |
241 |
} |
| 242 |
|
242 |
|
| 243 |
for (j = 1; nfds > 0 && j < idx_peers; j++) |
243 |
for (j = 1; nfds > 0 && j < idx_peers; j++) |
| 244 |
if (pfd[j].revents & POLLIN) { |
244 |
if (pfd[j].revents & (POLLIN|POLLERR)) { |
| 245 |
nfds--; |
245 |
nfds--; |
| 246 |
if (server_dispatch(pfd[j].fd, conf) == -1) |
246 |
if (server_dispatch(pfd[j].fd, conf) == -1) |
| 247 |
ntp_quit = 1; |
247 |
ntp_quit = 1; |
| 248 |
} |
248 |
} |
| 249 |
|
249 |
|
| 250 |
for (; nfds > 0 && j < i; j++) |
250 |
for (; nfds > 0 && j < i; j++) |
| 251 |
if (pfd[j].revents & POLLIN) { |
251 |
if (pfd[j].revents & (POLLIN|POLLERR)) { |
| 252 |
nfds--; |
252 |
nfds--; |
| 253 |
if (client_dispatch(idx2peer[j - idx_peers], |
253 |
if (client_dispatch(idx2peer[j - idx_peers], |
| 254 |
conf->settime) == -1) |
254 |
conf->settime) == -1) |