[Rpm-maint] [rpm-software-management/rpm] luaext/Pexec: optimize setting CLOEXEC (#444)
Kirill Kolyshkin
notifications at github.com
Thu May 17 21:24:14 UTC 2018
kolyshkin commented on this pull request.
> + struct dirent *entry;
+ while ((entry = readdir(dir)) != NULL) {
+ fd = atoi(entry->d_name);
+ if (fd >= min_fd)
+ set_cloexec(fd);
+ }
+ closedir(dir);
+
+ return;
+
+fallback:
+ // iterate over all possible fds
+ for (fd = min_fd; fd < open_max; fd++)
+ set_cloexec(fd);
+}
+
static int Pexec(lua_State *L) /** exec(path,[args]) */
Yes, ideally those two places need to be unified
--
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_r189105974
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180517/7f547e7b/attachment.html>
More information about the Rpm-maint
mailing list