|
|
|
@ -731,6 +731,7 @@ int sql_callback(exec_context &ec, sqlite3_stmt *stmt)
|
|
|
|
|
|
|
|
|
|
future<string> pipe_callback(exec_context &ec, const string &cmdline, auto_fd &fd)
|
|
|
|
|
{
|
|
|
|
|
if (lnav_data.ld_output_stack.empty()) {
|
|
|
|
|
auto pp = make_shared<piper_proc>(fd, false);
|
|
|
|
|
static int exec_count = 0;
|
|
|
|
|
char desc[128];
|
|
|
|
@ -754,6 +755,23 @@ future<string> pipe_callback(exec_context &ec, const string &cmdline, auto_fd &f
|
|
|
|
|
task();
|
|
|
|
|
|
|
|
|
|
return task.get_future();
|
|
|
|
|
} else {
|
|
|
|
|
return std::async(std::launch::async, [&]() {
|
|
|
|
|
FILE *file = lnav_data.ld_output_stack.top();
|
|
|
|
|
char buffer[1024];
|
|
|
|
|
ssize_t rc;
|
|
|
|
|
|
|
|
|
|
if (file == stdout) {
|
|
|
|
|
lnav_data.ld_stdout_used = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while ((rc = read(fd, buffer, sizeof(buffer))) > 0) {
|
|
|
|
|
fwrite(buffer, rc, 1, file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return string();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void add_global_vars(exec_context &ec)
|
|
|
|
|