Fixes: a068cf08 ("ucm: use closefrom instead of close_range")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
*/
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;
prog = bin;
}
- maxfd = sysconf(_SC_OPEN_MAX);
-
/*
* block SIGCHLD signal
* ignore SIGINT and SIGQUIT in parent
#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 */