]> git.proxmox.com Git - pve-zsync.git/commitdiff
avoid odd post-if style for die
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 4 May 2021 10:13:34 +0000 (12:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 4 May 2021 10:13:34 +0000 (12:13 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pve-zsync

index 170fc8cb843caae5df85a558da3ee82d0be7c11c..381746d58ee32e56fb19266a2de4aeab28cfa7cb 100755 (executable)
--- a/pve-zsync
+++ b/pve-zsync
@@ -438,10 +438,10 @@ sub update_cron {
     my $new_fh = IO::File->new("> ${CRONJOBS}.new");
     die "Could not open file ${CRONJOBS}.new: $!\n" if !$new_fh;
 
-    die "can't write to $CRONJOBS.new\n" if !print($new_fh $text);
+    print $new_fh $text or die "can't write to $CRONJOBS.new: $!\n";
     close ($new_fh);
 
-    die "can't move $CRONJOBS.new: $!\n" if !rename "${CRONJOBS}.new", $CRONJOBS;
+    rename "${CRONJOBS}.new", $CRONJOBS or die "can't move $CRONJOBS.new: $!\n";
 }
 
 sub format_job {