9 Mar
2021
9 Mar
'21
3:40 p.m.
stdio can buffer output, so if we close stdout without going through stdio, there might be buffered output that is never written. --- vsockserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsockserver.c b/vsockserver.c index dd9a74a..196056a 100644 --- a/vsockserver.c +++ b/vsockserver.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) if (notify) { printf("%" PRIu32 "\n", lport); - close(STDOUT_FILENO); + fclose(stdout); } setenvf("VSOCKLOCALCID", 1, "%" PRIu32, lcid); -- 2.30.0