All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eb@emlix.com>
To: patch@alsa-project.org
Cc: alsa-devel@alsa-project.org
Subject: [alsa-devel] [PATCH] do not set close-on-exec flag on descriptor if it was already set
Date: Tue, 11 Feb 2020 11:22:18 +0100	[thread overview]
Message-ID: <5948808.FfnTCzJfH2@devpool35> (raw)

There is no need to set this again if O_CLOEXEC is supported.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
---
 include/local.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/local.h b/include/local.h
index ea0ec32d..ed6ba936 100644
--- a/include/local.h
+++ b/include/local.h
@@ -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;
 }
 
-- 
2.25.0


-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

Besuchen Sie uns auf der Embedded World 2020 in Nürnberg!
-> Halle 4, Stand 368



_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2020-02-11 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 10:22 Rolf Eike Beer [this message]
2020-02-11 11:13 ` [alsa-devel] [PATCH] do not set close-on-exec flag on descriptor if it was already set Jaroslav Kysela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5948808.FfnTCzJfH2@devpool35 \
    --to=eb@emlix.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.