Pārlūkot izejas kodu

Fix execution of filters with async command

Serj Kalichev 1 gadu atpakaļ
vecāks
revīzija
60f4805191
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  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;
 		}