Helps to address bug #149
However, the underlying issue still isn't fixed. It isn't clear
why select() returns an error. An alternate solution might be
to simply re-do all of the FD_SET stuff, in the hope that
the cached version was wrong.
read_fds = master_fds;
rcode = select(maxfd + 1, &read_fds, NULL, NULL, wake);
if ((rcode < 0) && (errno != EINTR)) {
+ fr_strerror_printf("Failed in select: %s",
+ strerror(errno));
el->dispatch = 0;
- return 0;
+ return -1;
}
if (fr_heap_num_elements(el->times) > 0) {
radius_stats_init(1);
hup_mainconfig();
}
-
- radlog(L_INFO, "Exiting normally.");
-
+
+ if (rcode < 0) {
+ radlog(L_ERR, "Exiting due to internal error: %s",
+ fr_strerror());
+ rcode = 2;
+ } else {
+ radlog(L_INFO, "Exiting normally.");
+ }
+
/*
* Ignore the TERM signal: we're
* about to die.