From: Jochen Sprickerhof Date: Sun, 15 Jun 2025 08:10:52 +0000 (+0200) Subject: ucm: use close_range on _GNU_SOURCE X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=782b0597c25845cf8c48b3fe906e8374d1175f36;p=alsa-lib.git ucm: use close_range on _GNU_SOURCE Closes: https://github.com/alsa-project/alsa-lib/pull/459 Signed-off-by: Jochen Sprickerhof Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c index 276cf592..b79a84ae 100644 --- a/src/ucm/ucm_exec.c +++ b/src/ucm/ucm_exec.c @@ -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);