Re: [PATCH] do not set close-on-exec flag on descriptor if it was already set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dne 11. 02. 20 v 11:22 Rolf Eike Beer napsal(a):
There is no need to set this again if O_CLOEXEC is supported.

Thanks. Applied.

				Jroslav


Signed-off-by: Rolf Eike Beer <eb@xxxxxxxxx>
---
  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;
  }


--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux