Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jun 24, 2022
1 parent baa8f82 commit 4977704
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,10 @@ fn set_limits(config: &Config) -> Result<(), Error> {
.saturating_add(config.listen_addrs.len() as u32),
)
.saturating_add(16);
if let Err(_) = Resource::NOFILE.set(nb_descriptors as _, nb_descriptors as _) {
if Resource::NOFILE
.set(nb_descriptors as _, nb_descriptors as _)
.is_err()
{
let (_soft, hard) = Resource::NOFILE.get()?;
if nb_descriptors as u64 > hard as u64 {
warn!(
Expand Down

0 comments on commit 4977704

Please sign in to comment.