[cleanup]/abs_path foerste
authorHeiko Schlittermann <hs@schlittermann.de>
Wed, 30 Dec 2009 22:15:36 +0100
branchfoerste
changeset 47 ba9f62859590
parent 46 64adfc60fca9
child 48 2d6cb4466fb6
[cleanup]/abs_path Did some cosmetical cleanup (removed the commented SSL socket listener. Use abs_path() for finding the absolute path of a log file.
hlog.pl
--- a/hlog.pl	Tue Dec 29 15:08:09 2009 +0100
+++ b/hlog.pl	Wed Dec 30 22:15:36 2009 +0100
@@ -121,7 +121,7 @@
     }
 
     foreach ($opt_ssl_key, $opt_ssl_cert) {
-	$_ = abs_path($_) if defined;
+        $_ = abs_path($_) if defined;
     }
 
     ### $opt_ssl_key
@@ -172,36 +172,17 @@
     # resolve tags and filenames
     foreach (@ARGV) {
         $_ = "default=$_" if not /=/ or /^\//;
+
         my ($tag, $file) = split /=/, $_, 2;
+
         die "tag $tag already exists with file $FILE{$tag}\n"
           if exists $FILE{$tag};
-        $file = getcwd() . "/$file" if $file !~ /^\//;
+        $file = abs_path($file);
         $FILE{$tag} = $file;
     }
 
-    # start the listener
-    #    my $listener =
-    #      $opt_ssl
-    #      ? new IO::Socket::SSL(
-    #        LocalAddr     => $opt_addr,
-    #        LocalPort     => $opt_port,
-    #        Proto         => "tcp",
-    #        Listen        => 1,
-    #        ReuseAddr     => 1,
-    #        SSL           => $opt_ssl,
-    #        SSL_key_file  => $opt_ssl_key,
-    #        SSL_cert_file => $opt_ssl_cert,
-    #        #debug         => $opt_debug
-    #      )
-    #      : new IO::Socket::INET(
-    #        LocalAddr => $opt_addr,
-    #        LocalPort => $opt_port,
-    #        Proto     => "tcp",
-    #        Listen    => 1,
-    #        ReuseAddr => 1,
-    #        #debug     => $opt_debug,
-    #      );
-
+    # Start the listener, just a normal INET socket,
+    # SSL will be started later on, if needed..
     my $listener = new IO::Socket::INET(
         LocalAddr => $opt_addr,
         LocalPort => $opt_port,