summaryrefslogtreecommitdiff
path: root/test/test_pty.rs
AgeCommit message (Collapse)Author
2017-08-24Mark and document pty::ptsname() as unsafeNelson Chen
`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
2017-07-19Fix thread safety issues in pty and termios testsAlan Somers
ptsname(3) returns a pointer to a global variable, so it isn't thread-safe. Protect it with a mutex.
2017-07-15PtyMaster::drop should panic on EBADFAlan Somers
Also, document the double-close risk with unistd::close Fixes #659
2017-07-10Use libc types for termiosBryant Mairs
This also removes the incorrect TCSASOFT definition as an enum type because it's actually a bitfield.
2017-07-09Fix double close bugs in test_lseek and test_lseek64Alan Somers
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.
2017-07-01Handle short reads in pty testsAlan Somers
Some pty tests would fail intermittently because read(2) occasionally returns less data than requested.
2017-06-12Add openpty()Kelvin Ly
2017-05-16Add various pty functionsBryant Mairs
* grantpt * ptsname/ptsname_r * posix_openpt * unlockpt