- make CTRL-C work for retrieval and printing od MRU list.
bk: 5662e6a6H9DCWzmnJ6NP1atiKUlRVA
lots of clients. perlinger@ntp.org
* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
- changed stacked/nested handling of CTRL-C. perlinger@ntp.org
+ - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org
* Unity cleanup for FreeBSD-6.4. Harlan Stenn.
* Unity test cleanup. Harlan Stenn.
* Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn.
qsort(sorted, mru_count, sizeof(sorted[0]),
mru_qcmp_table[order]);
+ mrulist_interrupted = FALSE;
printf( "lstint avgint rstr r m v count rport remote address\n"
"==============================================================================\n");
/* '=' x 78 */
nntohost(&recent->addr));
if (showhostnames)
fflush(fp);
+ if (mrulist_interrupted) {
+ fputs("\n --interrupted--\n", fp);
+ fflush(fp);
+ break;
+ }
}
fflush(fp);
if (debug) {
FD_SET(sockfd, &fds);
n = select(sockfd+1, &fds, NULL, NULL, &tvo);
if (n == -1) {
+#if !defined(SYS_WINNT) && defined(EINTR)
+ /* Windows does not know about EINTR (until very
+ * recently) and the handling of console events
+ * is *very* different from POSIX/UNIX signal
+ * handling anyway.
+ *
+ * Under non-windows targets we map EINTR as
+ * 'last packet was received' and try to exit
+ * the receive sequence.
+ */
+ if (errno == EINTR) {
+ seenlastfrag = 1;
+ goto maybe_final;
+ }
+#endif
warning("select fails");
return -1;
}
* If we've seen the last fragment, look for holes in the sequence.
* If there aren't any, we're done.
*/
+ maybe_final:
if (seenlastfrag && offsets[0] == 0) {
for (f = 1; f < numfrags; f++)
if (offsets[f-1] + counts[f-1] !=