<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-legacy-support.
</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/286dd61c68b1fb9edfcede121a5a8f5959df9329">https://github.com/macports/macports-legacy-support/commit/286dd61c68b1fb9edfcede121a5a8f5959df9329</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 286dd61c68b1fb9edfcede121a5a8f5959df9329
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Mon Feb 19 19:54:20 2024 -0800
<span style='display:block; white-space:pre;color:#404040;'> fdopendir: Clarify some comments
</span>---
src/fdopendir.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/fdopendir.c b/src/fdopendir.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 79cd8ac..0b8c815 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/fdopendir.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/fdopendir.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -46,7 +46,10 @@ DIR *fdopendir(int dirfd) {
</span> if (!dir)
return 0;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Replace underlying fd with equivalent given fd (closed by closedir) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Replace underlying fd with supplied dirfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * A subsequent closedir() will close dirfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span>
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ == 1040
(void)close(dir->dd_fd);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -56,11 +59,14 @@ DIR *fdopendir(int dirfd) {
</span> dir->__dd_fd = dirfd;
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Rewind to the start of the directory (in case it's not there already) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Rewind to the start of the directory, in case the underlying file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * is not positioned at the start
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span>
rewinddir(dir);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Close given fd on exec (just in case not already done) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Close given fd on exec (as per fdopendir() docs) */
</span>
(void)fcntl(dirfd, F_SETFD, FD_CLOEXEC);
</pre><pre style='margin:0'>
</pre>