mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Merge.
This commit is contained in:
commit
245bbee0d5
4 changed files with 21 additions and 4 deletions
|
@ -779,14 +779,18 @@ signal_sigtimedwait(PyObject *self, PyObject *args)
|
|||
struct timespec buf;
|
||||
sigset_t set;
|
||||
siginfo_t si;
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
int err;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO:sigtimedwait",
|
||||
&signals, &timeout))
|
||||
return NULL;
|
||||
|
||||
if (_PyTime_ObjectToTimespec(timeout, &buf.tv_sec, &buf.tv_nsec) == -1)
|
||||
if (_PyTime_ObjectToTimespec(timeout, &tv_sec, &tv_nsec) == -1)
|
||||
return NULL;
|
||||
buf.tv_sec = tv_sec;
|
||||
buf.tv_nsec = tv_nsec;
|
||||
|
||||
if (buf.tv_sec < 0 || buf.tv_nsec < 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue