Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-112970: Detect and use closefrom() on platforms where it is available #112969

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Explicitly ignore closefrom return value
There are two variants of closefrom, one returns void, but another returns int,
so let's cast the return value to void to explicitly discard it to avoid -Wunused-result
warnings.

Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam committed Dec 11, 2023
commit 226037fd0f2607cac89721aeeb64258533e59af0
2 changes: 1 addition & 1 deletion Python/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2922,7 +2922,7 @@ _Py_closerange(int first, int last)
#ifdef USE_CLOSEFROM
if (last >= sysconf(_SC_OPEN_MAX)) {
/* Any errors encountered while closing file descriptors are ignored */
closefrom(first);
(void)closefrom(first);
}
else
#endif /* USE_CLOSEFROM */
Expand Down
Loading