- adds conditional supports for unix domain sockets
- adds unix domain socket test
- adds Results to functions, removing unwraps
- uutils `cat` used to panic on broken stdout pipes (e.g. `cat
/dev/zero | head -c1`). this is fixed in this PR
- updated to exit 0 on success, and 1 if an error occurs.
- adds docstrings
- adds an error log on printing a directory
- adds categorization of other filetypes for extensible
differentiation of behaviors
- adds OutputOptions struct to replace params for extensibility
- adds correct status code on exit
Fixes#1017.
test_mkdir_dup_dir asserted that creating an existing directory is an
error, but that's not how GNU coreutils behaves. This has been reported
in #121, but wasn't fixed (only the `-p` case was).
`test_chmod_ugoa` and `test_chmod_many_options` both change umask, which
is global state. Since tests run concurrently, this might lead to
a situation where one of the tests changes umask to a value that screws
another test's checks. To prevent this, we introduce a mutex that should
be held by any test that changes umask.
Unfortunately, there's no way to hide umask behind this mutex and
enforce its usage: programmers will have to maintain the discipline
themselves.
`test_chmod_many_options` relied on user's umask not denying read access
for anyone. 022, which is the default umask for many, indeed allows read
access for everyone. I'm using 027, which disallows read for everyone
but owner and group. This made tests fail.
Now tests set and reset umask, ensuring checks are run in a reliable,
predictable environment.
Fuchsia uses musl as its libc; musl only has stub implementation
for utmpx. From their wiki, that is deliberately chosen.
Fuchsia doesn't have signals mechanism.
/dev/pts/ptmx seems to be the only character special file in /dev
which is not a bind-mount in the docker container run by travis.
gnu stat does not detect these mounts, so produces a different
output for /dev/zero.