libtriple: try to make all filedescriptors O_CLOEXEC

This commit is contained in:
Stefan Seyfried
2011-12-04 15:54:49 +01:00
parent d6e681faf2
commit 5a8f5b3b20
5 changed files with 11 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ void cAudio::openDevice(void)
{
if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0)
lt_info("openDevice: open failed (%m)\n");
fcntl(fd, F_SETFD, FD_CLOEXEC);
}
else
lt_info("openDevice: already open (fd = %d)\n", fd);
@@ -185,6 +186,7 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
lt_info("%s open /dev/sound/dsp: %m\n", __FUNCTION__);
return -1;
}
fcntl(clipfd, F_SETFD, FD_CLOEXEC);
/* no idea if we ever get little_endian == 0 */
if (little_endian)
fmt = AFMT_S16_BE;