From 95d861d0283e47c64980c844d66be44c6c4aad8a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 24 Apr 2018 10:57:03 +0100 Subject: 42708: fix for process substitution. Don't close associated file descriptors in the closem() tidy up function as they should remain visible to external processes. Override if about to exit. Unit test for the failing case: note this relies on the existence of /proc/self/fd or equivalent. --- Src/Modules/clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Src/Modules/clone.c') diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c index 930429248..ef6275dcf 100644 --- a/Src/Modules/clone.c +++ b/Src/Modules/clone.c @@ -69,7 +69,7 @@ bin_clone(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) dup2(ttyfd,2); if (ttyfd > 2) close(ttyfd); - closem(0); + closem(FDT_UNUSED, 0); close(coprocin); close(coprocout); /* Acquire a controlling terminal */ -- cgit 1.4.1