Skip to content

Commit 5c96cd6

Browse files
committed
Use ROUND_CEILING again in some places where ROUND_UP is not needed
1 parent 80fa13e commit 5c96cd6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/selectmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ select_select(PyObject *self, PyObject *args)
221221
return NULL;
222222
}
223223

224-
if (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_UP) == -1)
224+
if (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_CEILING) == -1)
225225
return NULL;
226226
if (tv.tv_sec < 0) {
227227
PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
@@ -282,7 +282,7 @@ select_select(PyObject *self, PyObject *args)
282282
n = 0;
283283
break;
284284
}
285-
_PyTime_AsTimeval_noraise(timeout, &tv, _PyTime_ROUND_UP);
285+
_PyTime_AsTimeval_noraise(timeout, &tv, _PyTime_ROUND_CEILING);
286286
/* retry select() with the recomputed timeout */
287287
}
288288
} while (1);
@@ -594,7 +594,7 @@ poll_poll(pollObject *self, PyObject *args)
594594
poll_result = 0;
595595
break;
596596
}
597-
ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_UP);
597+
ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
598598
/* retry poll() with the recomputed timeout */
599599
}
600600
} while (1);
@@ -941,7 +941,7 @@ devpoll_poll(devpollObject *self, PyObject *args)
941941
poll_result = 0;
942942
break;
943943
}
944-
ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_UP);
944+
ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
945945
dvp.dp_timeout = (int)ms;
946946
/* retry devpoll() with the recomputed timeout */
947947
}

0 commit comments

Comments
 (0)