1
1
mirror of https://github.com/tstack/lnav.git synced 2024-10-26 21:19:54 +03:00

[grep_proc] do not restart the proc during destruction

This commit is contained in:
Timothy Stack 2013-06-20 20:36:19 -07:00
parent ab9b193917
commit d9cf6aa668
3 changed files with 33 additions and 1 deletions

View File

@ -68,6 +68,7 @@ grep_proc::grep_proc(pcre *code,
grep_proc::~grep_proc()
{
this->gp_queue.clear();
this->cleanup();
}
@ -127,6 +128,7 @@ void grep_proc::start(void)
fcntl(err_fd[0], F_SETFL, O_NONBLOCK);
fcntl(err_fd[0], F_SETFD, 1);
assert(this->gp_err_pipe.get() == -1);
this->gp_err_pipe = err_fd[0];
this->gp_child_started = true;

View File

@ -109,13 +109,28 @@ bool listview_curses::handle_key(int ch)
break;
case KEY_END:
case 'B':
this->set_top(max(vis_line_t(0),
max(this->lv_top,
vis_line_t(this->get_inner_height() - height +
1))));
break;
case 'A':
{
double tenth = ((double)this->get_inner_height()) / 10.0;
this->shift_top(vis_line_t(tenth));
}
break;
case 'B':
{
double tenth = ((double)this->get_inner_height()) / 10.0;
this->shift_top(vis_line_t(-tenth));
}
break;
default:
retval = false;
break;

View File

@ -2687,6 +2687,21 @@ static void looper(void)
case EINTR:
break;
case EBADF:
{
int lpc, fd_flags;
fprintf(stderr, "bad file descriptor\n");
for (lpc = 0; lpc < FD_SETSIZE; lpc++) {
if (fcntl(lpc, F_GETFD, &fd_flags) == -1 &&
FD_ISSET(lpc, &lnav_data.ld_read_fds)) {
fprintf(stderr, "bad fd %d\n", lpc);
}
}
lnav_data.ld_looping = false;
}
break;
default:
fprintf(stderr, "select %s\n", strerror(errno));
lnav_data.ld_looping = false;