Skip to content

Commit 3ccb96c

Browse files
authored
bpo-41056: Use the fildes converter for fd to please Coverity. (GH-21011)
There are a bunch of other fd: int uses in this file, I expect many if not all of them would be better off using the fildes converter. This particular one was flagged by Coverity as it presumably flags fpathconf as not accepting negative fds. I'd expect the other fd's to have been flagged as well otherwise. I'm marking this one as skip news as it really is a no-op.
1 parent eb0d5c3 commit 3ccb96c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Invalid file descriptor values are now prevented from being passed to os.fpathconf. (discovered by Coverity)

Modules/clinic/posixmodule.c.h

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10988,7 +10988,7 @@ conv_path_confname(PyObject *arg, int *valuep)
1098810988
/*[clinic input]
1098910989
os.fpathconf -> long
1099010990
10991-
fd: int
10991+
fd: fildes
1099210992
name: path_confname
1099310993
/
1099410994
@@ -10999,7 +10999,7 @@ If there is no limit, return -1.
1099910999

1100011000
static long
1100111001
os_fpathconf_impl(PyObject *module, int fd, int name)
11002-
/*[clinic end generated code: output=d5b7042425fc3e21 input=5942a024d3777810]*/
11002+
/*[clinic end generated code: output=d5b7042425fc3e21 input=5b8d2471cfaae186]*/
1100311003
{
1100411004
long limit;
1100511005

0 commit comments

Comments
 (0)