Age | Commit message (Collapse) | Author |
|
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
|
|
|
|
|
|
|
|
|
|
https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states
|
|
* Remove a redundant closure.
* Comparison with null
* Manual implementation of find
* Suppress a false positive
|
|
Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
|
|
It has never actually executed its command, so the only reason that it
ever worked is that on most systems there are usually processes starting
and exiting all the time.
|
|
* enabled as much functionality and defines that match
updated libc definitions for haiku
|
|
|
|
|
|
|
|
parking_lot provides synchronization primitives which aren't
poisoned on panic. This makes it easier to determine which tests
are failing, as a test failure no longer causes all subsequent tests
using that mutex to fail.
|
|
And this time, start running Clippy in CI
|
|
|
|
Also, split the overbroad test_mknod_family into two tests
|
|
Add From<User> for libc::passwd trait implementation to convert
a User into a libc::passwd
Implementation consumes the User struct, giving ownership over
the internal members to the libc::passwd struct
Add the User::gecos field to 64-bit Android builds, since it is
supported by libc::passwd for those builds
|
|
Now that Nix's weird error types are eliminated, there's no reason not
to simply use Errno as the Error type.
|
|
For many of Nix's consumers it be convenient to easily convert a Nix
error into a std::io::Error. That's currently not possible because of
the InvalidPath, InvalidUtf8, and UnsupportedOperation types that have
no equivalent in std::io::Error.
However, very few of Nix's public APIs actually return those unusual
errors. So a more useful API would be for Nix's standard error type to
implement Into<std::io::Error>.
This commit makes Error a simple NewType around Errno. For most
functions it's a drop-in replacement. There are only three exceptions:
* clearenv now returns a bespoke error type. It was the only Nix
function whose error couldn't be cleanly mapped onto an Errno.
* sys::signal::signal now returns Error(Errno::ENOTSUP) instead of
Error::UnsupportedOperation when the user passes an incompatible
argument to `handler`.
* When a NixPath exceeds PATH_MAX, it will now return
Error(Errno::ENAMETOOLONG) instead of Error::InvalidPath.
In the latter two cases there is now some abiguity about whether the
error code was generated by Nix or by the OS. But I think the ambiguity
is worth it for the sake of being able to implement Into<io::Error>.
This commit also introduces Error::Sys() as a migration aid. Previously
that as an enum variant. Now it's a function, but it will work in many
of the same contexts as the original.
Fixes #1155
|
|
|
|
|
|
* Fix race conditions in the tests. Two tests were grabbing a mutex but
immediately dropping it. Thank you, Clippy.
* Remove vestigial Windows support. Remove some code added to support
Windows in 2015. Nix is no longer intended to ever run on Windows.
* Various other minor Clippy lints.
|
|
|
|
Travis didn't compile check tests on platforms that couldn't run tests
in CI, so they bitrotted. Let's see how bad they are.
Most annoyingly, 32-bit Android defines mode_t as 16 bits, but
stat.st_mode as 32-bits.
|
|
Co-authored-by: Dominik Hassler <hadfl@omnios.org>
Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
|
|
Closes #1339.
|
|
Allow nix to compile on Fuchsia by conditionally avoiding libc
functionality that does not exist for Fuchsia.
|
|
In older versions of Musl, ttyname_r would wrongly return ENOTTY instead
of EBADF. We expected that bug in our test suite. But Rust
1.37.0 updated Musl to 1.1.22, which fixes the problem. This change
reverts our workaround.
https://www.openwall.com/lists/musl/2018/09/15/2
https://github.com/rust-lang/rust/commit/aaf66987931dfe06a547b9f68cb709e9b6265b5c
|
|
On Cirrus-CI, these tests frequently segfault. It's probably indicative
of a real bug, not just a problem in the tests. But for now we need to
skip them to get CI working.
Issue #555
|
|
The test was assuming that once dropped, a temporary file's file
descriptor would be invalid. But it might not be, because another file
might be opened with the same file descriptor. Instead, use an
obviously invalid file descriptor.
|
|
Ensure that the exec functions' arguments are valid for 'static.
Previously they were short-lived temporaries.
|
|
Travis has been super-slow lately (> 6 hours per build). Cirrus is much
faster: about 20 minutes. Cirrus also has slightly better test
coverage, mainly because it doesn't use SECCOMP.
Also,
* Fix the Redox CI build. The old Travis configuration didn't actually
build for Redox, so we never noticed that Redox can't be built with a
stable compiler. Thanks to @coolreader18 for finding this.
* Disable the udp_offload tests on cross-tested platforms. These tests
are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a
lack of support in QEMU. These tests were skipped on Travis because
its kernel was too old.
* Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux
kernel version as 4.19.112+, which the semver crate can't handle.
* Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the
file in /tmp gets deleted as soon as it's closed. Probably an
overzealous temporary file cleaner. Use /var/tmp, because no
temporary file cleaner should run in there.
* Skip mount tests on Cirrus. They fail for an unknown reason.
Issue #1351
* Skip the AF_ALG tests on Cirrus-CI
Issue #1352
|
|
When run in Cirrus-CI's environment, the tests generate copious SIGRT_1
signals. This commit ensures that test_alarm will ignore them.
|
|
|
|
Fix tests. No change in documentation.
Resolves #1030.
|
|
|
|
1224: Update the Linux CI environment to Ubuntu Bionic r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Alan Somers <asomers@axcient.com>
|
|
|
|
|
|
1255: Remove several deprecated constants and functions r=asomers a=asomers
* `unistd::daemon` on Apple
* `unistd::pipe2` on Apple
* `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple
* `sys::event::FilterFlag::NOTE_REAP` on Apple
* `sys::ptrace::ptrace` on Android and Linux
All have been deprecated for more than two releases and one year.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
* `unistd::daemon` on Apple
* `unistd::pipe2` on Apple
* `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple
* `sys::event::FilterFlag::NOTE_REAP` on Apple
* `sys::ptrace::ptrace` on Android and Linux
All have been deprecated for more than two releases and one year.
|
|
|
|
- Make sure all tests pass the CI
- Redox does not (yet) have passwd functions, so remove it
|
|
|
|
TODO: Fix them in Relibc
|
|
|
|
|