Age | Commit message (Collapse) | Author |
|
`ptsname()` mutates global variables and mutating global variables is
always considered `unsafe` by Rust.
Reference:
https://github.com/nix-rust/nix/pull/742#issuecomment-324385919
|
|
ptsname(3) returns a pointer to a global variable, so it isn't
thread-safe. Protect it with a mutex.
|
|
Also, document the double-close risk with unistd::close
Fixes #659
|
|
This also removes the incorrect TCSASOFT definition as an enum type because it's
actually a bitfield.
|
|
std::fs::File closes the underlying file descriptor on Drop, without
checking for errors. test_lseek and test_lseek64 also manually close
the file descriptor. That works for single threaded test runs. But for
multithreaded runs, it causes EBADF errors in other tests. Fix the
tests by consuming the File with into_raw_fd(), so its drop method will
never be called.
Also, fix a potential short read bug in the same tests.
|
|
Some pty tests would fail intermittently because read(2) occasionally
returns less data than requested.
|
|
|
|
* grantpt
* ptsname/ptsname_r
* posix_openpt
* unlockpt
|