Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: alsa-devel@alsa-project.org
Subject: [PATCH 2/3] Remove old commented-out FD_CLOEXEC code
Date: Wed,  4 Nov 2009 20:38:52 +0200	[thread overview]
Message-ID: <1257359933-3791-2-git-send-email-remi@remlab.net> (raw)
In-Reply-To: <200911042038.09618.rem@videolan.org>

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
---
 src/control/control_hw.c |   11 -----------
 src/hwdep/hwdep_hw.c     |   11 -----------
 src/pcm/pcm_hw.c         |   12 ------------
 src/rawmidi/rawmidi_hw.c |   11 -----------
 src/seq/seq_hw.c         |   11 -----------
 src/timer/timer_hw.c     |   11 -----------
 6 files changed, 0 insertions(+), 67 deletions(-)

diff --git a/src/control/control_hw.c b/src/control/control_hw.c
index e9a6be2..cf258b4 100644
--- a/src/control/control_hw.c
+++ b/src/control/control_hw.c
@@ -392,17 +392,6 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
 		if (fd < 0)
 			return -errno;
 	}
-#if 0
-	/*
-	 * this is bogus, an application have to care about open filedescriptors
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		SYSERR("fcntl FD_CLOEXEC failed");
-		err = -errno;
-		close(fd);
-		return err;
-	}
-#endif
 	if (ioctl(fd, SNDRV_CTL_IOCTL_PVERSION, &ver) < 0) {
 		err = -errno;
 		close(fd);
diff --git a/src/hwdep/hwdep_hw.c b/src/hwdep/hwdep_hw.c
index 238a507..e4fcdc3 100644
--- a/src/hwdep/hwdep_hw.c
+++ b/src/hwdep/hwdep_hw.c
@@ -122,17 +122,6 @@ int snd_hwdep_hw_open(snd_hwdep_t **handle, const char *name, int card, int devi
 		if (fd < 0)
 			return -errno;
 	}
-#if 0
-	/*
-	 * this is bogus, an application have to care about open filedescriptors
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		SYSERR("fcntl FD_CLOEXEC failed");
-		ret = -errno;
-		close(fd);
-		return ret;
-	}
-#endif
 	if (ioctl(fd, SNDRV_HWDEP_IOCTL_PVERSION, &ver) < 0) {
 		ret = -errno;
 		close(fd);
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 8abb204..2095b01 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1144,18 +1144,6 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
 	if (fmode & O_ASYNC)
 		mode |= SND_PCM_ASYNC;
 
-#if 0
-	/*
-	 * this is bogus, an application have to care about open filedescriptors
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		ret = -errno;
-		SYSMSG("fcntl FD_CLOEXEC failed");
-		close(fd);
-		return ret;
-	}
-#endif
-
 	if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
 		ret = -errno;
 		SYSMSG("SNDRV_PCM_IOCTL_PVERSION failed");
diff --git a/src/rawmidi/rawmidi_hw.c b/src/rawmidi/rawmidi_hw.c
index 87829fd..e08dca7 100644
--- a/src/rawmidi/rawmidi_hw.c
+++ b/src/rawmidi/rawmidi_hw.c
@@ -234,17 +234,6 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
 			return -errno;
 		}
 	}
-#if 0
-	/*
-	 * this is bogus, an application have to care about open filedescriptors
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		SYSERR("fcntl FD_CLOEXEC failed");
-		ret = -errno;
-		close(fd);
-		return ret;
-	}
-#endif
 	if (ioctl(fd, SNDRV_RAWMIDI_IOCTL_PVERSION, &ver) < 0) {
 		ret = -errno;
 		SYSERR("SNDRV_RAWMIDI_IOCTL_PVERSION failed");
diff --git a/src/seq/seq_hw.c b/src/seq/seq_hw.c
index 0e94593..5bb26f3 100644
--- a/src/seq/seq_hw.c
+++ b/src/seq/seq_hw.c
@@ -457,17 +457,6 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
 		SYSERR("open %s failed", filename);
 		return -errno;
 	}
-#if 0
-	/*
-         * this is bogus, an application have to care about open filedescriptors
-	 */                          
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		SYSERR("fcntl FD_CLOEXEC failed");
-		ret = -errno;
-		close(fd);
-		return ret;
-	}
-#endif
 	if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) {
 		SYSERR("SNDRV_SEQ_IOCTL_PVERSION failed");
 		ret = -errno;
diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c
index 3453858..25f3bab 100644
--- a/src/timer/timer_hw.c
+++ b/src/timer/timer_hw.c
@@ -236,17 +236,6 @@ int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int
 	fd = snd_open_device(SNDRV_FILE_TIMER, tmode);
 	if (fd < 0)
 		return -errno;
-#if 0
-	/*
-	 * this is bogus, an application have to care about open filedescriptors
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
-		SYSERR("fcntl FD_CLOEXEC failed");
-		ret = -errno;
-		close(fd);
-		return ret;
-	}
-#endif
 	if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) {
 		ret = -errno;
 		close(fd);
-- 
1.6.5.2

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

  parent reply	other threads:[~2009-11-04 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 18:38 [RESEND] [PATCH 0/3] Close alsa-lib file descriptors on exec Rémi Denis-Courmont
2009-11-04 18:38 ` [PATCH 1/3] Open device nodes with close-on-exec flag Rémi Denis-Courmont
2009-11-04 19:03   ` Lennart Poettering
2009-11-04 18:38 ` Rémi Denis-Courmont [this message]
2009-11-04 18:38 ` [PATCH 3/3] Define _GNU_SOURCE so that <fcntl.h> gives O_CLOEXEC Rémi Denis-Courmont
  -- strict thread matches above, loose matches on Subject: below --
2009-11-05 19:16 [PATCHv2 alsa-lib 0/3] Close-on-exec flag for device nodes Rémi Denis-Courmont
2009-11-05 19:17 ` [PATCH 2/3] Remove old commented-out FD_CLOEXEC code Rémi Denis-Courmont

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=1257359933-3791-2-git-send-email-remi@remlab.net \
    --to=remi@remlab.net \
    --cc=alsa-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox