Skip to content

Commit

Permalink
Simplify cfgs
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <[email protected]>
Signed-off-by: James Sturtevant <[email protected]>
  • Loading branch information
jsturtevant committed Aug 17, 2023
1 parent 71d268b commit f6d1f45
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/containerd-shim-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pub mod sandbox;
mod macros;
pub mod services;

#[cfg(feature = "libcontainer")]
#[cfg(all(feature = "libcontainer", not(target_os = "windows")))]
pub mod libcontainer_instance;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg(unix)]
use crate::sandbox::oci;
use libcontainer::workload::default::DefaultExecutor;
use libcontainer::workload::{Executor, ExecutorError};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg(unix)]
//! Abstractions for running/managing a wasm/wasi instance that uses youki's libcontainer library.
use anyhow::Context;
Expand Down
2 changes: 0 additions & 2 deletions crates/containerd-shim-wasm/src/libcontainer_instance/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(unix)]

pub mod container_executor;
pub mod instance;

Expand Down
4 changes: 2 additions & 2 deletions crates/containerd-shim-wasm/src/sandbox/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub type ExitCode = Arc<(Mutex<Option<(u32, DateTime<Utc>)>>, Condvar)>;

#[cfg(unix)]
use libc::SIGKILL;
#[cfg(windows)]
const SIGKILL: i32 = 9;

/// Generic options builder for creating a wasm instance.
/// This is passed to the `Instance::new` method.
Expand Down Expand Up @@ -192,7 +194,6 @@ impl Instance for Nop {
}
fn kill(&self, signal: u32) -> Result<(), Error> {
let code = match signal as i32 {
#[cfg(unix)]
SIGKILL => 137,
SIGINT | SIGTERM => 0,
s => {
Expand Down Expand Up @@ -226,7 +227,6 @@ mod noptests {

use super::*;

#[cfg(unix)]
#[test]
fn test_nop_kill_sigkill() -> Result<(), Error> {
let nop = Nop::new("".to_string(), None);
Expand Down

0 comments on commit f6d1f45

Please sign in to comment.