mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-28 01:40:08 -05:00
ucm: exec - fix maxfd used warning
Fixes: a068cf08 ("ucm: use closefrom instead of close_range")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
a068cf08ad
commit
813ffe34ff
1 changed files with 6 additions and 5 deletions
|
|
@ -183,7 +183,7 @@ static int parse_args(char ***argv, int argc, const char *cmd)
|
||||||
*/
|
*/
|
||||||
int uc_mgr_exec(const char *prog)
|
int uc_mgr_exec(const char *prog)
|
||||||
{
|
{
|
||||||
pid_t p, f, maxfd;
|
pid_t p, f;
|
||||||
int err = 0, status;
|
int err = 0, status;
|
||||||
char bin[PATH_MAX];
|
char bin[PATH_MAX];
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
|
@ -212,8 +212,6 @@ int uc_mgr_exec(const char *prog)
|
||||||
prog = bin;
|
prog = bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxfd = sysconf(_SC_OPEN_MAX);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* block SIGCHLD signal
|
* block SIGCHLD signal
|
||||||
* ignore SIGINT and SIGQUIT in parent
|
* ignore SIGINT and SIGQUIT in parent
|
||||||
|
|
@ -262,8 +260,11 @@ int uc_mgr_exec(const char *prog)
|
||||||
#if HAVE_DECL_CLOSEFROM
|
#if HAVE_DECL_CLOSEFROM
|
||||||
closefrom(3);
|
closefrom(3);
|
||||||
#else
|
#else
|
||||||
for (f = 3; f < maxfd; f++)
|
{
|
||||||
close(f);
|
pid_t maxfd = sysconf(_SC_OPEN_MAX);
|
||||||
|
for (f = 3; f < maxfd; f++)
|
||||||
|
close(f);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* install default handlers for the forked process */
|
/* install default handlers for the forked process */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue