mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-11-23 15:39:58 +00: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
@ -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…
Reference in New Issue
Block a user