summary refs log tree commit diff
path: root/io_jail
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-09-20 14:41:40 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-22 01:43:11 -0700
commita1422e6bcab81492d20ae312c92cdc2491705876 (patch)
tree11ba1cfc1630e94ea4736c649d42ae1380bd10b6 /io_jail
parent0a4f280e3a1c3ba77e1efa37c18bbdcea03a0d64 (diff)
downloadcrosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.gz
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.bz2
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.lz
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.xz
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.zst
crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.zip
fix warning and bit rotted tests uncovered by kokoro
TEST=run kokoro presubmit
BUG=None

Change-Id: I301551f8f58263f1a8b7a8276867881cb17517ab
Reviewed-on: https://chromium-review.googlesource.com/1236889
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Diffstat (limited to 'io_jail')
-rw-r--r--io_jail/src/lib.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/io_jail/src/lib.rs b/io_jail/src/lib.rs
index b6f0aea..e711b30 100644
--- a/io_jail/src/lib.rs
+++ b/io_jail/src/lib.rs
@@ -497,14 +497,12 @@ impl Minijail {
     /// This Function may abort in the child on error because a partially
     /// entered jail isn't recoverable.
     pub unsafe fn fork(&self, inheritable_fds: Option<&[RawFd]>) -> Result<pid_t> {
-        // This test will fail during `cargo test` because the test harness always spawns a test
-        // thread. We will make an exception for that case because the tests for this module should
-        // always be run in a serial fashion using `--test-threads=1`.
-        #[cfg(not(test))]
-        {
-            if !is_single_threaded().map_err(Error::CheckingMultiThreaded)? {
-                return Err(Error::ForkingWhileMultiThreaded);
-            }
+        if !is_single_threaded().map_err(Error::CheckingMultiThreaded)? {
+            // This test will fail during `cargo test` because the test harness always spawns a test
+            // thread. We will make an exception for that case because the tests for this module
+            // should always be run in a serial fashion using `--test-threads=1`.
+            #[cfg(not(test))]
+            return Err(Error::ForkingWhileMultiThreaded);
         }
 
         if let Some(keep_fds) = inheritable_fds {