Skip to content

Commit

Permalink
Merge pull request #79 from kpcyrd/no-macos-ulimit
Browse files Browse the repository at this point in the history
Only try to bump ulimit on Linux due to MacOS issues
  • Loading branch information
kpcyrd authored Jan 14, 2021
2 parents 53079c9 + 0fe3c3f commit bc78811
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 bc78811

Please sign in to comment.