Sfoglia il codice sorgente

Fix execution of filters with async command

Serj Kalichev 1 anno fa
parent
commit
60f4805191
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      klish/ksession/kexec.c

+ 5 - 0
klish/ksession/kexec.c

@@ -641,6 +641,11 @@ static bool_t exec_action_sequence(const kexec_t *exec, kcontext_t *context,
 		// Is it end of ACTION sequence?
 		if (!iter) {
 			kcontext_set_done(context, BOOL_TRUE);
+			// Close the stdout of finished ACTION sequence to inform
+			// process next in pipe about EOF. Else filter will not
+			// stop at all.
+			close(kcontext_stdout(context));
+			kcontext_set_stdout(context, -1);
 			return BOOL_TRUE;
 		}