ucm: use close_range on _GNU_SOURCE

This commit is contained in:
Jochen Sprickerhof 2025-06-15 10:10:52 +02:00
parent 07ec2ad34c
commit 2566687eba
No known key found for this signature in database
GPG key ID: 5BFFDCC258E69433

View file

@ -254,8 +254,12 @@ int uc_mgr_exec(const char *prog)
close(f);
#if defined(_GNU_SOURCE)
close_range(3, maxfd, 0);
#else
for (f = 3; f < maxfd; f++)
close(f);
#endif
/* install default handlers for the forked process */
signal(SIGINT, SIG_DFL);