From def937676961327f44b33a12c9bae6819656c565 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Sun, 12 Mar 2023 18:44:18 +0000 Subject: [PATCH] link.pl: make failures fatal Don't just log things, we should stop hard... --- tools/link.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/link.pl b/tools/link.pl index e7b18111..60a1cbd1 100644 --- a/tools/link.pl +++ b/tools/link.pl @@ -35,19 +35,19 @@ sub good_link ($$) { if ($symlink_farm) { print "Symlink: $dest => $src\n" if ($link_verbose >= 3); if (not symlink ($src, $dest)) { - print STDERR "Symlink from $src to $dest failed: $!\n"; + die "Symlink from $src to $dest failed: $!\n"; } } elsif ($link_copy) { print "Copy: $dest => $src\n" if ($link_verbose >= 3); if (system("cp -ap $src $dest")) { my $err_num = $? >> 8; my $sig_num = $? & 127; - print STDERR "Copy from $src to $dest failed: cp exited with error code $err_num, signal $sig_num\n"; + die "Copy from $src to $dest failed: cp exited with error code $err_num, signal $sig_num\n"; } } else { print "Hardlink: $dest => $src\n" if ($link_verbose >= 3); if (not link ($src, $dest)) { - print STDERR "Link from $src to $dest failed: $!\n"; + die "Link from $src to $dest failed: $!\n"; } } } @@ -64,7 +64,7 @@ sub real_file ($) { if ($to = readlink($link)) { $link = $dir . $to; } else { - print STDERR "Can't readlink $link: $!\n"; + die "Can't readlink $link: $!\n"; } }