From: Tom Yu Date: Mon, 8 Aug 2016 13:12:16 +0000 (-0400) Subject: Improve EINTR handling in bttest X-Git-Tag: krb5-1.15-beta1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbf6e70d04c094b6cf0ef076a62ef4ca27001183;p=thirdparty%2Fkrb5.git Improve EINTR handling in bttest The libdb2 btree debugging program bttest doesn't handle EINTR in its input loop. This causes difficulties with debugging using lldb, because bttest gets signals like SIGSTOP when being attached, and lldb doesn't seem to share the terminal well with a program being debugged. ticket: 8478 (new) subject: usability improvements for bttest --- diff --git a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c index 0d78d59343..2aee3a32c0 100644 --- a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c +++ b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c @@ -232,8 +232,14 @@ user(db) for (last = 0;;) { (void)printf("> "); (void)fflush(stdout); - if ((lbuf = fgets(&buf[0], 512, ifp)) == NULL) + if ((lbuf = fgets(&buf[0], 512, ifp)) == NULL) { + (void)printf("\n"); + if (ferror(ifp) && errno == EINTR) { + clearerr(ifp); + continue; + } break; + } if (lbuf[0] == '\n') { i = last; goto uselast;