[Rpm-maint] [rpm-software-management/rpm] luaext/Pexec: optimize setting CLOEXEC (#444)

Kirill Kolyshkin notifications at github.com
Thu May 17 21:24:20 UTC 2018


kolyshkin commented on this pull request.



> @@ -330,26 +330,64 @@ static int Pmkfifo(lua_State *L)		/** mkfifo(path) */
 }
 
 
+static void set_cloexec(int fd)
+{
+	int flag = fcntl(fd, F_GETFD);
+
+	if (flag == -1 || (flag & FD_CLOEXEC))
+		return;
+
+	fcntl(fd, F_SETFD, FD_CLOEXEC);

This I just copied from the old code (and the only known flag for now is CLOEXEC).

Anyway, will do.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/444#discussion_r189106021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180517/fc339432/attachment-0001.html>


More information about the Rpm-maint mailing list