diff --git a/lib/dev.ml b/lib/dev.ml index 54ef201..b90c70e 100644 --- a/lib/dev.ml +++ b/lib/dev.ml @@ -1888,6 +1888,7 @@ let merged_main_source = {c| #include #include #include +#include #include #include #include @@ -1918,6 +1919,11 @@ static void flan_merged_exit(int32_t status) { (void)status; fflush(NULL); close(1); + /* ...and take fd 1 straight back, because POSIX hands out the lowest free + * descriptor: leave it open and the compiler thread's next socket or file + * becomes this process's stdout, and the next llc inherits it. The EOF is + * unaffected — the pipe's write end is genuinely gone. */ + if (open("/dev/null", O_WRONLY) < 0) { /* nothing useful to do about it */ } for (;;) pause(); }