Kaydet (Commit) e7c41937 authored tarafından Guido van Rossum's avatar Guido van Rossum

In tcsetattr(), first initialize the mode structure by calling

tcgetattr().  This seems to be the only correct way to cope with
platform-specific structure members...
üst ae9ee732
......@@ -139,6 +139,9 @@ termios_tcsetattr(self, args)
return NULL;
}
/* Get the old mode, in case there are any hidden fields... */
if (tcgetattr(fd, &mode) == -1)
return PyErr_SetFromErrno(TermiosError);
mode.c_iflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 0));
mode.c_oflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 1));
mode.c_cflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment