mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
speed up startup
Authored-by: Baptiste Daroussin <bapt@FreeBSD.org>
This commit is contained in:
parent
10b9031763
commit
d654c32dc8
1 changed files with 9 additions and 0 deletions
|
|
@ -2851,11 +2851,20 @@ int pa_close_allv(const int except_fds[]) {
|
|||
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
maxfd = 0;
|
||||
for (int i = 0; except_fds[i] >= 0; i++)
|
||||
if (except_fds[i] > maxfd)
|
||||
maxfd = except_fds[i];
|
||||
maxfd++;
|
||||
closefrom(maxfd);
|
||||
#else
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) >= 0)
|
||||
maxfd = (int) rl.rlim_max;
|
||||
else
|
||||
maxfd = sysconf(_SC_OPEN_MAX);
|
||||
|
||||
#endif
|
||||
for (fd = 3; fd < maxfd; fd++) {
|
||||
int i;
|
||||
bool found;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue