Age | Commit message (Collapse) | Author |
|
And this time, start running Clippy in CI
|
|
Co-authored-by: Dominik Hassler <hadfl@omnios.org>
Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
|
|
After the child returns from a fork() of a multi-threaded process, it is
undefined behaviour to call non-async-signal-safe functions according to
POSIX. Since forkpty() is implemented in terms of fork(), those
restrictions should apply to it too.
|
|
The pseudo-terminal device handling tests in some places make
tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file
descriptor rather than the subordinate terminal descriptor. This works
on some systems, but not all; others such as illumos (and presumably
Solaris) are more strict and require the termios requests be made
against the terminal descriptor only.
|
|
|
|
`PtyMaster` acts like an owned file descriptor, even closing on `Drop`.
Implementing `io::Read` and `io::Write` lets it be used directly in
standard I/O operations.
|
|
`assert_eq!` gives more debug info when the test fails by default than
`assert!`. This should help make debugging easier.
|
|
|
|
|
|
|
|
Several tests make the assumption that all data is written, which
is not guaranteed with write(), so use write_all() instead.
|
|
The libc_bitflags! macro was replaced with a non-recursive one supporting
only public structs. I could not figure out how to make the old macro work
with the upgrade, so I reworked part of the bitflags! macro directly to suit
our needs, much as the original recursive macro was made. There are no uses
of this macro for non-public structs, so this is not a problem for internal code.
|
|
`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
|