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] <support@github.com>

* Use new api

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
dependabot[bot] 2021-07-19 17:22:11 +00:00 committed by GitHub
parent 4015e638e4
commit 6abafac479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 9 deletions

5
Cargo.lock generated
View File

@ -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",
]

View File

@ -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"] }

View File

@ -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()

View File

@ -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()