Code

- Corrected open perl function, corrected variable passing to open and close
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:29:07 +0000 (23:29 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:29:07 +0000 (23:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17318 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/krb5.pm
gosa-si/client/events/load_reporter.pm

index c0cc930a6af67e0c82737a8ac1cf49abdafabbfb..30d23e008d3b58de6e59f696a045b0b60cbf3ffa 100644 (file)
@@ -1,5 +1,14 @@
 package krb5;
+
+
+use strict;
+use warnings;
+
 use Exporter;
+use GOSA::GosaSupportDaemon;
+use Authen::Krb5;
+use Authen::Krb5::Admin qw(:constants);
+
 @ISA = qw(Exporter);
 my @events = (
     "get_events",
@@ -17,12 +26,6 @@ my @events = (
     );
 @EXPORT = @events;
 
-use strict;
-use warnings;
-use GOSA::GosaSupportDaemon;
-use Authen::Krb5;
-use Authen::Krb5::Admin qw(:constants);
-
 BEGIN {}
 
 END {}
index d68f28107bdcd75003e963f8f0fc0f6ba6e4bc3f..9227b729c1c123c454837dbb4c5e735f3d27f5ed 100644 (file)
@@ -1,22 +1,25 @@
 package load_reporter;
-use Exporter;
-@ISA = qw(Exporter);
-my @events = (
-    "get_events",
-    "get_terminal_server",
-       "get_load",
-       "report_load",
-       "set_terminal_server",
-    );
-@EXPORT = @events;
+
 
 use strict;
 use warnings;
+use Exporter;
+
 use GOSA::GosaSupportDaemon;
 
 BEGIN {}
 END {}
 
+@ISA = qw(Exporter);
+my @events = (
+    "get_events",
+    "get_terminal_server",
+  "get_load",
+  "report_load",
+  "set_terminal_server",
+    );
+@EXPORT = @events;
+
 my $ts_load_file;
 my $waiting_for_ts_info;
 my %cfg_defaults = (
@@ -55,9 +58,9 @@ sub get_load
 
        my $file = "/proc/loadavg";
        if ((not -f $file) || (not -r $file)) { return }
-       open(FHD, "<$file");
-       my $line = <FHD>;
-       close(FHD);
+       open($FHD, "<", "$file");
+       my $line = <$FHD>;
+       close($FHD);
        chomp($line);
 
        $out_msg = &create_xml_string(&create_xml_hash("report_load", $target, $source, $line));
@@ -83,9 +86,9 @@ sub set_terminal_server
        {
                $file_content .= "$ts $load\n";
        }
-       open(FHD, ">$ts_load_file.part");
-       printf FHD $file_content;
-       close FHD;
+       open($FHD, ">", "$ts_load_file.part");
+       printf $FHD $file_content;
+       close($FHD);
 
        system("mv $ts_load_file.part $ts_load_file");
        &main::daemon_log("INFO: Wrote terminal server load information to $ts_load_file", 5);