Make all fopen() calls use O_CLOEXEC

by adding "e" to the mode strings.
This commit is contained in:
Demi Marie Obenour 2022-09-23 10:40:55 -04:00 committed by Wim Taymans
parent 400860f63c
commit bb4f274ae0
10 changed files with 23 additions and 23 deletions

View file

@ -256,7 +256,7 @@ static int check_device_pcm_class(const char *devname)
/* Check device class */
spa_scnprintf(path, sizeof(path), "/sys/class/sound/%s/pcm_class",
devname);
f = fopen(path, "r");
f = fopen(path, "re");
if (f == NULL)
return -errno;
sz = fread(buf, 1, sizeof(buf) - 1, f);
@ -361,7 +361,7 @@ static int check_device_available(struct impl *this, struct device *device, int
spa_scnprintf(path, sizeof(path), "/proc/asound/card%u/%s/%s/status",
(unsigned int)device->id, entry->d_name, entry_pcm->d_name);
f = fopen(path, "r");
f = fopen(path, "re");
if (f == NULL)
goto done;
sz = fread(buf, 1, 6, f);