]> dxcluster.org Git - spider.git/commitdiff
attempt to get rid of some of the useless messages on program exit
authordjk <djk>
Mon, 24 May 1999 10:46:44 +0000 (10:46 +0000)
committerdjk <djk>
Mon, 24 May 1999 10:46:44 +0000 (10:46 +0000)
perl/DXDebug.pm
perl/DXLog.pm
perl/client.pl
perl/cluster.pl

index 64ed843944d7d478c4466f541933e75bca0af418..c44ba35920f5d049291a4021b78b845c1406a606 100644 (file)
@@ -11,8 +11,8 @@ package DXDebug;
 
 require Exporter;
 @ISA = qw(Exporter);
-@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg);
-@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg);
+@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose);
+@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose);
 
 use strict;
 use vars qw(%dbglevel $fp);
@@ -36,6 +36,12 @@ if (!defined $DB::VERSION) {
        };
 }
 
+sub dbgclose
+{
+       $SIG{__DIE__} = $SIG{__WARN__} = 'DEFAULT';
+       $fp->close();
+}
+
 sub dbg
 {
        my $l = shift;
index 8cc6f8504b35a842304b2443e1f3d9ac23dc3d23..2dc6d2feec4136958eb46678f953137ecf5343b5 100644 (file)
@@ -177,7 +177,7 @@ sub Log
 sub DESTROY                                            # catch undefs and do what is required further down the tree
 {
        my $self = shift;
-       DXDebug::dbg("dxlog", "closing $self->{fn}\n");
+#      DXDebug::dbg("dxlog", "closing $self->{fn}\n");
        undef $self->{fh} if defined $self->{fh};
 } 
 1;
index 4a4069f07313c0a6d567bbb14a90e76eb499224d..c6f5bd2806c12d0ad0359af074fbf132cc7821ed 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 #
 # A thing that implements dxcluster 'protocol'
 #
@@ -59,6 +59,7 @@ sub cease
                dbg('connect', "killing $pid");
                kill(9, $pid);
        }
+       dbgclose();
        sleep(1);
        exit(0);        
 }
index 3014e24fd7cf45bb4e6e3af622de45f4f1b50720..b471c754ec82a7999c39b8c50b69e0287ad05292 100755 (executable)
@@ -193,6 +193,7 @@ sub cease
        DXUser::finish();
        dbg('chan', "DXSpider version $version ended");
        Log('cluster', "DXSpider V$version stopped");
+       dbgclose();
        unlink $lockfn;
        exit(0);
 }