summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-07-11 17:45:59 +0000
committerPeter Palfrader <peter@palfrader.org>2002-07-11 17:45:59 +0000
commit4842bac893d6762bd75628f45ba9669c73493312 (patch)
tree5d47b4431461d2fe032933bd23dd866bc6b505f0
parent12d96eb0146f7e96012bba12c13a7a12282494aa (diff)
Use cluck or confess instead of croak
-rw-r--r--Echolot/Config.pm6
-rw-r--r--Echolot/Mailin.pm4
-rw-r--r--Echolot/Scheduler.pm6
-rwxr-xr-xpingd14
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 <peter@palfrader.org>
-# $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 = <CONFIGCODE>;
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 <peter@palfrader.org>
-# $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 <peter@palfrader.org>
-# $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 <peter@palfrader.org>
-# $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 = <PIDFILE>;
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");
};
};
};