Skip to content

Commit

Permalink
Revert "set fd limit when starting"
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrchien committed May 22, 2022
1 parent 16795cf commit 11f61f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "realm"
version = "2.3.3"
version = "2.3.4"
authors = ["zhboner <[email protected]>"]
edition = "2021"

Expand Down
13 changes: 6 additions & 7 deletions src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ fn handle_matches(matches: ArgMatches) -> CmdInput {
{
use realm_syscall::{get_nofile_limit, set_nofile_limit};

let nofile = matches.value_of("nofile").map_or_else(
|| get_nofile_limit().map_or(None, |(_, hard)| Some(hard)),
|nofile| Some(nofile.parse().unwrap()),
);

// set
if let Some(nofile) = nofile {
let _ = set_nofile_limit(nofile);
if let Some(nofile) = matches.value_of("nofile") {
if let Ok(nofile) = nofile.parse::<u64>() {
let _ = set_nofile_limit(nofile);
} else {
eprintln!("invalid nofile value: {}", nofile);
}
}

// get
Expand Down

0 comments on commit 11f61f3

Please sign in to comment.