Skip to content

Commit

Permalink
Only try to bump ulimit on Linux due to MacOS issues
Browse files Browse the repository at this point in the history
See #78
  • Loading branch information
kpcyrd committed Jan 14, 2021
1 parent 53079c9 commit 0fe3c3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ dirs-next = "2.0"

[target."cfg(unix)".dependencies]
termios = "0.3"

[target.'cfg(target_os="linux")'.dependencies]
rlimit = "0.5"
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ pub mod runtime;
pub mod scheduler;
pub mod sockets;
pub mod structs;
#[cfg(unix)]
#[cfg(target_os="linux")]
pub mod ulimit;
pub mod utils;
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn main() -> Result<()> {
}

let config = Arc::new(Config::load()?);
#[cfg(unix)]
#[cfg(target_os="linux")]
badtouch::ulimit::set_nofile(&config)
.context("Failed to set RLIMIT_NOFILE")?;

Expand Down

0 comments on commit 0fe3c3f

Please sign in to comment.