Skip to content

Commit a5e032e

Browse files
committed
bpo-41839: Fix error checking in sched_get_priority_ functions
1 parent 16ebae4 commit a5e032e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6813,7 +6813,7 @@ os_sched_get_priority_max_impl(PyObject *module, int policy)
68136813
int max;
68146814

68156815
max = sched_get_priority_max(policy);
6816-
if (max < 0)
6816+
if (max == -1)
68176817
return posix_error();
68186818
return PyLong_FromLong(max);
68196819
}
@@ -6832,7 +6832,7 @@ os_sched_get_priority_min_impl(PyObject *module, int policy)
68326832
/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
68336833
{
68346834
int min = sched_get_priority_min(policy);
6835-
if (min < 0)
6835+
if (max == -1)
68366836
return posix_error();
68376837
return PyLong_FromLong(min);
68386838
}

0 commit comments

Comments
 (0)