mirror of git://git.sv.gnu.org/nano.git
filtering: wait for the data-sending process to terminate too
When piping the buffer (or the marked region) to an external command, we should wait not only for the external command to terminate but also for the data-sending process, so that it will release its resources. This fixes https://savannah.gnu.org/bugs/?54499. With-help-from: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
This commit is contained in:
parent
3218d8358a
commit
ec339d3b08
|
@ -1241,8 +1241,11 @@ bool execute_command(const char *command)
|
|||
openfile->undotop->strdata = mallocstrcpy(NULL, _("filtering"));
|
||||
}
|
||||
|
||||
/* Wait for the external command (and possibly data sender) to terminate. */
|
||||
if (wait(NULL) == -1)
|
||||
nperror("wait");
|
||||
if (should_pipe && (wait(NULL) == -1))
|
||||
nperror("wait");
|
||||
|
||||
/* If it was changed, restore the handler for SIGINT. */
|
||||
if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
|
||||
|
|
Loading…
Reference in New Issue