libtriple: try to make all filedescriptors O_CLOEXEC

Origin commit data
------------------
Branch: ni/coolstream
Commit: 4d9be7852d
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-12-04 (Sun, 04 Dec 2011)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2011-12-04 15:54:49 +01:00
parent 58c62daada
commit 724b91e6d9
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;