Skip to content

Commit 5e70bef

Browse files
committed
gh-144023: fd_and_follow_symlinks_invalid lets fd be 0
0 is a valid fd, so we do not want this and followsimlinks.
1 parent 59d3594 commit 5e70bef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ static int
16371637
fd_and_follow_symlinks_invalid(const char *function_name, int fd,
16381638
int follow_symlinks)
16391639
{
1640-
if ((fd > 0) && (!follow_symlinks)) {
1640+
if ((fd >= 0) && (!follow_symlinks)) {
16411641
PyErr_Format(PyExc_ValueError,
16421642
"%s: cannot use fd and follow_symlinks together",
16431643
function_name);

0 commit comments

Comments
 (0)