mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
do not set close-on-exec flag on descriptor if it was already set
There is no need to set this again if O_CLOEXEC is supported. Signed-off-by: Rolf Eike Beer <eb@emlix.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
5bc3d4c4c1
commit
b367274b4d
1 changed files with 2 additions and 0 deletions
|
|
@ -320,8 +320,10 @@ static inline int snd_open_device(const char *filename, int fmode)
|
|||
fd = rsm_open_device(filename, fmode);
|
||||
}
|
||||
#endif
|
||||
#ifndef O_CLOEXEC
|
||||
if (fd >= 0)
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue