From 4842bac893d6762bd75628f45ba9669c73493312 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 11 Jul 2002 17:45:59 +0000 Subject: Use cluck or confess instead of croak --- Echolot/Config.pm | 6 +++--- Echolot/Mailin.pm | 4 ++-- Echolot/Scheduler.pm | 6 +++--- pingd | 14 +++++++------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Echolot/Config.pm b/Echolot/Config.pm index b651d81..604a9ba 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -1,7 +1,7 @@ package Echolot::Config; # (c) 2002 Peter Palfrader -# $Id: Config.pm,v 1.22 2002/07/10 21:46:28 weasel Exp $ +# $Id: Config.pm,v 1.23 2002/07/11 17:45:59 weasel Exp $ # =pod @@ -148,13 +148,13 @@ sub init($) { { local $/ = undef; open(CONFIGCODE, $configfile) or - croak("Could not open configfile '$configfile': $!"); + confess("Could not open configfile '$configfile': $!"); my $config_code = ; close (CONFIGCODE); ($config_code) = $config_code =~ /^(.*)$/s; eval ($config_code); ($EVAL_ERROR) and - croak("Evaling config code from '$configfile' returned error: $EVAL_ERROR"); + confess("Evaling config code from '$configfile' returned error: $EVAL_ERROR"); } for my $key (keys %$DEFAULT) { diff --git a/Echolot/Mailin.pm b/Echolot/Mailin.pm index 7ecaa9a..f845758 100644 --- a/Echolot/Mailin.pm +++ b/Echolot/Mailin.pm @@ -1,7 +1,7 @@ package Echolot::Mailin; # (c) 2002 Peter Palfrader -# $Id: Mailin.pm,v 1.4 2002/07/06 00:50:27 weasel Exp $ +# $Id: Mailin.pm,v 1.5 2002/07/11 17:45:59 weasel Exp $ # =pod @@ -99,7 +99,7 @@ sub process() { Echolot::Globals::get()->{'storage'}->delay_commit(); for my $file (@files) { $file =~ /^(.*)$/s or - croak("I really should match here. ('$file')."); + confess("I really should match here. ('$file')."); $file = $1; if (handle($mailindir.'/'.$file)) { unlink($mailindir.'/'.$file); diff --git a/Echolot/Scheduler.pm b/Echolot/Scheduler.pm index 99730e1..8bf700a 100644 --- a/Echolot/Scheduler.pm +++ b/Echolot/Scheduler.pm @@ -1,7 +1,7 @@ package Echolot::Scheduler; # (c) 2002 Peter Palfrader -# $Id: Scheduler.pm,v 1.7 2002/07/02 13:57:09 weasel Exp $ +# $Id: Scheduler.pm,v 1.8 2002/07/11 17:45:59 weasel Exp $ # =pod @@ -114,7 +114,7 @@ sub run($) { my ($self) = @_; (defined $self->{'schedule'}->[0]) or - croak("Scheduler is empty"), + cluck("Scheduler is empty"), return 0; while(1) { @@ -145,7 +145,7 @@ sub run($) { ($self->{'tasks'}->{$name}->{'interval'} > 0); (defined $self->{'schedule'}->[0]) or - croak("Scheduler is empty"), + cluck("Scheduler is empty"), return 0; } while ($now >= $self->{'schedule'}->[0]->{'start'}); }; diff --git a/pingd b/pingd index 75af997..fcfa2d5 100755 --- a/pingd +++ b/pingd @@ -3,7 +3,7 @@ $| = 1; # (c) 2002 Peter Palfrader -# $Id: pingd,v 1.33 2002/07/11 17:40:34 weasel Exp $ +# $Id: pingd,v 1.34 2002/07/11 17:45:59 weasel Exp $ # =pod @@ -353,7 +353,7 @@ sub daemon_run($) { die ("Pidfile '".Echolot::Config::get()->{'pidfile'}."' exists\n") if pid_exists(); open (PIDFILE, '>'.Echolot::Config::get()->{'pidfile'}) or - croak ("Cannot open pidfile '".Echolot::Config::get()->{'pidfile'}."': $!\n"); + confess ("Cannot open pidfile '".Echolot::Config::get()->{'pidfile'}."': $!\n"); print PIDFILE "$PROCESS_ID ".Echolot::Globals::get()->{'hostname'}." ".time()."\n"; close PIDFILE; @@ -394,15 +394,15 @@ sub send_sig($) { die ("Pidfile '".Echolot::Config::get()->{'pidfile'}."' does not exist\n") unless pid_exists(); open (PIDFILE, '<'.Echolot::Config::get()->{'pidfile'}) or - croak ("Cannot open pidfile '".Echolot::Config::get()->{'pidfile'}."': $!\n"); + confess ("Cannot open pidfile '".Echolot::Config::get()->{'pidfile'}."': $!\n"); my $line = ; close PIDFILE; my ($pid, $host, $time) = $line =~ /^(\d+) \s+ (\S+) \s+ (\d+) \s* $/x or - croak ("Cannot parse pidfile '$line'\n"); + confess ("Cannot parse pidfile '$line'\n"); my $sent = kill $sig, $pid; ($sent == 1) or - croak ("Did not send signal $sig to exactly one process but $sent. (pidfile reads $line)\n"); + confess ("Did not send signal $sig to exactly one process but $sent. (pidfile reads $line)\n"); }; sub daemon_hup() { @@ -424,7 +424,7 @@ sub make_dirs() { ) { if ( ! -d $dir ) { mkdir ($dir) or - croak ("Cannot create directory $dir: $!\n"); + confess ("Cannot create directory $dir: $!\n"); }; }; for my $dir ( @@ -439,7 +439,7 @@ sub make_dirs() { ) { if ( ! -d $dir ) { mkdir ($dir, 0700) or - croak ("Cannot create directory $dir: $!\n"); + confess ("Cannot create directory $dir: $!\n"); }; }; }; -- cgit v1.2.3