.. like in the `delete_encryption_key` subroutine below, as it's more readable at a glance.
Signed-off-by: Max Carrara <m.carr...@proxmox.com> --- src/PVE/PBSClient.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index ab1fa62..d707971 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -77,7 +77,10 @@ sub delete_password { my $pwfile = password_file_name($self); - unlink $pwfile or $! == ENOENT or die "deleting password file failed - $!\n"; + if (!unlink($pwfile)) { + return if $! == ENOENT; + die "deleting password file failed - $!\n"; + } }; sub get_password { -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel