Instrument safe_close() to make it easy to see where an fd is closed from

This commit is contained in:
Kovid Goyal
2020-07-14 20:18:04 +05:30
parent 6d59e2125e
commit 392f576d07
6 changed files with 30 additions and 25 deletions

View File

@@ -142,7 +142,7 @@ close_tty(PyObject *self UNUSED, PyObject *args) {
TTY_ARGS
tcsetattr(fd, TCSAFLUSH, termios_p); // deliberately ignore failure
free(termios_p);
safe_close(fd);
safe_close(fd, __FILE__, __LINE__);
Py_RETURN_NONE;
}