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
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;