mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
use pa_fopen_cloexec() where applicable
This commit is contained in:
parent
88b72958be
commit
168be3830a
14 changed files with 27 additions and 27 deletions
|
|
@ -63,7 +63,7 @@ static int detect_alsa(pa_core *c, int just_one) {
|
|||
FILE *f;
|
||||
int n = 0, n_sink = 0, n_source = 0;
|
||||
|
||||
if (!(f = fopen("/proc/asound/devices", "r"))) {
|
||||
if (!(f = pa_fopen_cloexec("/proc/asound/devices", "r"))) {
|
||||
|
||||
if (errno != ENOENT)
|
||||
pa_log_error("open(\"/proc/asound/devices\") failed: %s", pa_cstrerror(errno));
|
||||
|
|
@ -124,9 +124,9 @@ static int detect_oss(pa_core *c, int just_one) {
|
|||
FILE *f;
|
||||
int n = 0, b = 0;
|
||||
|
||||
if (!(f = fopen("/dev/sndstat", "r")) &&
|
||||
!(f = fopen("/proc/sndstat", "r")) &&
|
||||
!(f = fopen("/proc/asound/oss/sndstat", "r"))) {
|
||||
if (!(f = pa_fopen_cloexec("/dev/sndstat", "r")) &&
|
||||
!(f = pa_fopen_cloexec("/proc/sndstat", "r")) &&
|
||||
!(f = pa_fopen_cloexec("/proc/asound/oss/sndstat", "r"))) {
|
||||
|
||||
if (errno != ENOENT)
|
||||
pa_log_error("failed to open OSS sndstat device: %s", pa_cstrerror(errno));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue