mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -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)
|
||||
{
|
||||
pid_t p, f, maxfd;
|
||||
pid_t p, f;
|
||||
int err = 0, status;
|
||||
char bin[PATH_MAX];
|
||||
struct sigaction sa;
|
||||
|
|
@ -212,8 +212,6 @@ int uc_mgr_exec(const char *prog)
|
|||
prog = bin;
|
||||
}
|
||||
|
||||
maxfd = sysconf(_SC_OPEN_MAX);
|
||||
|
||||
/*
|
||||
* block SIGCHLD signal
|
||||
* ignore SIGINT and SIGQUIT in parent
|
||||
|
|
@ -262,8 +260,11 @@ int uc_mgr_exec(const char *prog)
|
|||
#if HAVE_DECL_CLOSEFROM
|
||||
closefrom(3);
|
||||
#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
|
||||
|
||||
/* install default handlers for the forked process */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue