1
1
mirror of https://github.com/tstack/lnav.git synced 2024-09-11 13:05:51 +03:00

fix piping lnav

This commit is contained in:
Timothy Stack 2015-03-31 13:00:10 -07:00
parent 7efedcdafc
commit 66c5d9413e

View File

@ -111,7 +111,9 @@ piper_proc::piper_proc(int pipefd, bool timestamp, const char *filename)
int nullfd;
nullfd = open("/dev/null", O_RDWR);
dup2(nullfd, STDIN_FILENO);
if (pipefd != STDIN_FILENO) {
dup2(nullfd, STDIN_FILENO);
}
dup2(nullfd, STDOUT_FILENO);
for (int fd_to_close = 0; fd_to_close < 1024; fd_to_close++) {
int flags;