From 6abafac479e031a878e64a766093e90af57353fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:22:11 +0000 Subject: [PATCH] chore: bump fd-lock from 2.0.0 to 3.0.0 (#18756) * chore: bump fd-lock from 2.0.0 to 3.0.0 Bumps [fd-lock](https://github.com/yoshuawuyts/fd-lock) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/yoshuawuyts/fd-lock/releases) - [Commits](https://github.com/yoshuawuyts/fd-lock/commits) --- updated-dependencies: - dependency-name: fd-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Use new api Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyera Eulberg --- Cargo.lock | 5 +++-- validator/Cargo.toml | 2 +- validator/src/bin/solana-test-validator.rs | 5 ++--- validator/src/main.rs | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 170b34456e..445d53ca1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,10 +1375,11 @@ dependencies = [ [[package]] name = "fd-lock" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0010f02effd88c702318c5dde0463206be67495d0b4d906ba7c0a8f166cc7f06" +checksum = "b8806dd91a06a7a403a8e596f9bfbfb34e469efbc363fc9c9713e79e26472e36" dependencies = [ + "cfg-if 1.0.0", "libc", "winapi 0.3.8", ] diff --git a/validator/Cargo.toml b/validator/Cargo.toml index 71d5eb2ab1..a7329706e8 100644 --- a/validator/Cargo.toml +++ b/validator/Cargo.toml @@ -17,7 +17,7 @@ chrono = { version = "0.4.11", features = ["serde"] } clap = "2.33.1" console = "0.14.1" core_affinity = "0.5.10" -fd-lock = "2.0.0" +fd-lock = "3.0.0" indicatif = "0.16.2" jsonrpc-core = "17.1.0" jsonrpc-core-client = { version = "17.1.0", features = ["ipc", "ws"] } diff --git a/validator/src/bin/solana-test-validator.rs b/validator/src/bin/solana-test-validator.rs index efe5c6073d..eeaa59bc31 100644 --- a/validator/src/bin/solana-test-validator.rs +++ b/validator/src/bin/solana-test-validator.rs @@ -1,6 +1,5 @@ use { clap::{value_t, value_t_or_exit, App, Arg}, - fd_lock::FdLock, solana_clap_utils::{ input_parsers::{pubkey_of, pubkeys_of, value_of}, input_validators::{ @@ -402,8 +401,8 @@ fn main() { }); } - let mut ledger_fd_lock = FdLock::new(fs::File::open(&ledger_path).unwrap()); - let _ledger_lock = ledger_fd_lock.try_lock().unwrap_or_else(|_| { + let mut ledger_fd_lock = fd_lock::RwLock::new(fs::File::open(&ledger_path).unwrap()); + let _ledger_lock = ledger_fd_lock.try_write().unwrap_or_else(|_| { println!( "Error: Unable to lock {} directory. Check if another validator is running", ledger_path.display() diff --git a/validator/src/main.rs b/validator/src/main.rs index cd6747c0b0..e269a0c174 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -5,7 +5,6 @@ use { AppSettings, Arg, ArgMatches, SubCommand, }, console::style, - fd_lock::FdLock, log::*, rand::{seq::SliceRandom, thread_rng, Rng}, solana_clap_utils::{ @@ -2501,8 +2500,8 @@ pub fn main() { }) }); - let mut ledger_fd_lock = FdLock::new(fs::File::open(&ledger_path).unwrap()); - let _ledger_lock = ledger_fd_lock.try_lock().unwrap_or_else(|_| { + let mut ledger_fd_lock = fd_lock::RwLock::new(fs::File::open(&ledger_path).unwrap()); + let _ledger_lock = ledger_fd_lock.try_write().unwrap_or_else(|_| { println!( "Error: Unable to lock {} directory. Check if another validator is running", ledger_path.display()