]> git.alsa-project.org Git - alsa-lib.git/commitdiff
do not set close-on-exec flag on descriptor if it was already set
authorRolf Eike Beer <eb@emlix.com>
Tue, 11 Feb 2020 10:22:18 +0000 (11:22 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 11 Feb 2020 11:13:08 +0000 (12:13 +0100)
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>
include/local.h

index ea0ec32d96b39e96d4a36359b568d52660736edb..ed6ba93664ddba8ff03f9e0d12ab15d95a061705 100644 (file)
@@ -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;
 }