]> git.refcnt.org Git - distdns.git/commitdiff
Prefix error message with program name
authorSteven Schubiger <stsc@refcnt.org>
Sun, 1 Sep 2013 19:49:01 +0000 (21:49 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Sun, 1 Sep 2013 19:49:01 +0000 (21:49 +0200)
client.pl

index 1d03898ac44b17cbe201696c8364aa04cf23f8a2..86ff3d94ab808925b93822e0cd18b06be820f2bb 100755 (executable)
--- a/client.pl
+++ b/client.pl
@@ -79,14 +79,14 @@ my $save_session = sub
 {
     my ($session) = @_;
 
-    open(my $fh, '>', $session_file) or die "Cannot open client-side $session_file for writing: $!\n";
+    open(my $fh, '>', $session_file) or die "$0: Cannot open client-side $session_file for writing: $!\n";
     print {$fh} "$session\n";
     close($fh);
 };
 
 my $get_session = sub
 {
-    open(my $fh, '<', $session_file) or die "Cannot open client-side $session_file for reading: $!\nPerhaps try running --init\n";
+    open(my $fh, '<', $session_file) or die "$0: Cannot open client-side $session_file for reading: $!\nPerhaps try running --init\n";
     my $session = do { local $/; <$fh> };
     chomp $session;
     close($fh);