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
4 changed files with 8 additions and 9 deletions

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