mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
ucm: use closefrom instead of close_range
closefrom is a library function with a fallback mechanism for when the kernel does not support the close_range syscall. Also check for the function properly instead of assuming it is available with _GNU_SOURCE defined. Closes: https://github.com/alsa-project/alsa-lib/pull/486 Fixes: https://github.com/alsa-project/alsa-lib/issues/485 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
70e413c5bb
commit
a068cf08ad
2 changed files with 3 additions and 2 deletions
|
|
@ -52,6 +52,7 @@ dnl Checks for library functions.
|
|||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_CHECK_FUNCS([uselocale])
|
||||
AC_CHECK_FUNCS([eaccess])
|
||||
AC_CHECK_DECLS([closefrom])
|
||||
|
||||
dnl Enable largefile support
|
||||
AC_SYS_LARGEFILE
|
||||
|
|
|
|||
|
|
@ -259,8 +259,8 @@ int uc_mgr_exec(const char *prog)
|
|||
|
||||
close(f);
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
close_range(3, maxfd, 0);
|
||||
#if HAVE_DECL_CLOSEFROM
|
||||
closefrom(3);
|
||||
#else
|
||||
for (f = 3; f < maxfd; f++)
|
||||
close(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue