1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

tests/chmod: protect umask with a mutex

`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.
This commit is contained in:
Alexander Batischev 2016-12-19 13:02:58 +03:00
parent 60f6f61ac9
commit 655804cff4
4 changed files with 13 additions and 0 deletions

View file

@ -1,6 +1,9 @@
#[macro_use]
mod common;
#[macro_use]
extern crate lazy_static;
// For conditional compilation
macro_rules! unix_only {
($($fea:expr, $m:ident);+) => {