update to nix 0.24 / rustyline 9 / proxmox-sys 0.3

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2022-06-02 13:10:33 +02:00
parent 68a6e970d4
commit 11ca834317
34 changed files with 95 additions and 78 deletions

View File

@ -15,7 +15,7 @@ hex = { version = "0.4.3", features = [ "serde" ] }
lazy_static = "1.4"
libc = "0.2"
log = "0.4.17"
nix = "0.19.1"
nix = "0.24"
openssl = "0.10"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
@ -32,7 +32,7 @@ proxmox-lang = "1.1"
proxmox-schema = { version = "1.3.1", features = [ "api-macro" ] }
proxmox-time = "1"
proxmox-uuid = "1"
proxmox-sys = "0.2"
proxmox-sys = "0.3"
pbs-api-types = { path = "../pbs-api-types" }
pbs-buildcfg = { path = "../pbs-buildcfg" }

View File

@ -147,7 +147,7 @@ impl BackupGroup {
/* close else this leaks! */
nix::unistd::close(rawfd)?;
}
Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => {
Err(nix::errno::Errno::ENOENT) => {
return Ok(());
}
Err(err) => {

View File

@ -221,7 +221,7 @@ impl ChunkStore {
})?;
if let Err(err) = res {
if !assert_exists && err.as_errno() == Some(nix::errno::Errno::ENOENT) {
if !assert_exists && err == nix::errno::Errno::ENOENT {
return Ok(false);
}
bail!("update atime failed for chunk/file {path:?} - {err}");
@ -304,7 +304,7 @@ impl ChunkStore {
// start reading:
continue;
}
Err(ref err) if err.as_errno() == Some(nix::errno::Errno::ENOENT) => {
Err(ref err) if err == &nix::errno::Errno::ENOENT => {
// non-existing directories are okay, just keep going:
continue;
}

View File

@ -433,7 +433,7 @@ impl DataStore {
ty_dir.push(ty.to_string());
// best effort only, but we probably should log the error
if let Err(err) = unlinkat(Some(base_fd), &ty_dir, UnlinkatFlags::RemoveDir) {
if err.as_errno() != Some(nix::errno::Errno::ENOENT) {
if err != nix::errno::Errno::ENOENT {
log::error!("failed to remove backup type {ty} in {ns} - {err}");
}
}
@ -483,10 +483,10 @@ impl DataStore {
if !ns.is_root() {
match unlinkat(Some(base_fd), &ns.path(), UnlinkatFlags::RemoveDir) {
Ok(()) => log::debug!("removed namespace {ns}"),
Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => {
Err(nix::errno::Errno::ENOENT) => {
log::debug!("namespace {ns} already removed")
}
Err(nix::Error::Sys(nix::errno::Errno::ENOTEMPTY)) if !delete_groups => {
Err(nix::errno::Errno::ENOTEMPTY) if !delete_groups => {
removed_all_requested = false;
log::debug!("skip removal of non-empty namespace {ns}")
}

View File

@ -196,7 +196,7 @@ impl Iterator for ListNamespaces {
let ns_dirfd = match proxmox_sys::fs::read_subdir(libc::AT_FDCWD, &base_path) {
Ok(dirfd) => dirfd,
Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => return None,
Err(nix::errno::Errno::ENOENT) => return None,
Err(err) => return Some(Err(err.into())),
};
// found a ns directory, descend into it to scan all it's namespaces