From 11f61f36bfea5fcb2413d2c334e78dd0fdd52512 Mon Sep 17 00:00:00 2001 From: zephyr Date: Sun, 22 May 2022 12:37:48 +0900 Subject: [PATCH] Revert "set fd limit when starting" --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd/mod.rs | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d53e50e..af70a737 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -824,7 +824,7 @@ dependencies = [ [[package]] name = "realm" -version = "2.3.3" +version = "2.3.4" dependencies = [ "cfg-if", "chrono", diff --git a/Cargo.toml b/Cargo.toml index fc0fc93c..0e20eb15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "realm" -version = "2.3.3" +version = "2.3.4" authors = ["zhboner "] edition = "2021" diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 8879c9bb..c325f466 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -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::() { + let _ = set_nofile_limit(nofile); + } else { + eprintln!("invalid nofile value: {}", nofile); + } } // get