Browse Source

Fix execution of filters with async command

Serj Kalichev 1 year ago
parent
commit
60f4805191
1 changed files with 5 additions and 0 deletions
  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;
 		}