mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Merge.
This commit is contained in:
commit
245bbee0d5
4 changed files with 21 additions and 4 deletions
|
@ -185,14 +185,18 @@ time_clock_settime(PyObject *self, PyObject *args)
|
|||
{
|
||||
int clk_id;
|
||||
PyObject *obj;
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
struct timespec tp;
|
||||
int ret;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:clock_settime", &clk_id, &obj))
|
||||
return NULL;
|
||||
|
||||
if (_PyTime_ObjectToTimespec(obj, &tp.tv_sec, &tp.tv_nsec) == -1)
|
||||
if (_PyTime_ObjectToTimespec(obj, &tv_sec, &tv_nsec) == -1)
|
||||
return NULL;
|
||||
tp.tv_sec = tv_sec;
|
||||
tp.tv_nsec = tv_nsec;
|
||||
|
||||
ret = clock_settime((clockid_t)clk_id, &tp);
|
||||
if (ret != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue