From: opensides Date: Sat, 27 Mar 2010 23:39:31 +0000 (+0000) Subject: - Corrected open perl function, corrected variable passing to open and close X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=524d4ecc059721a6d38a21010f9763988003645c;p=gosa.git - Corrected open perl function, corrected variable passing to open and close git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17321 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/ClientPackages.pm b/gosa-si/modules/ClientPackages.pm index fb8aab830..8fc6318bc 100644 --- a/gosa-si/modules/ClientPackages.pm +++ b/gosa-si/modules/ClientPackages.pm @@ -1,12 +1,11 @@ package ClientPackages; -use Exporter; -@ISA = ("Exporter"); - # Each module has to have a function 'process_incoming_msg'. This function works as a interface to gosa-sd and receives the msg hash from gosa-sd. 'process_incoming_function checks, wether it has a function to process the incoming msg and forward the msg to it. use strict; use warnings; + +use Exporter; use GOSA::GosaSupportDaemon; use IO::Socket::INET; use XML::Simple; @@ -17,6 +16,8 @@ use Net::LDAP::Util; use Socket; use Net::hostent; +@ISA = ("Exporter"); + my $event_dir = "/usr/lib/gosa-si/server/ClientPackages"; use lib "/usr/lib/gosa-si/server/ClientPackages"; @@ -451,9 +452,9 @@ sub here_i_am { if ( defined($msg_hash->{'force-hostname'}[0]) && length($msg_hash->{'force-hostname'}[0]) > 0){ # $heap->{force-hostname}->{$mac_address}= $msg_hash->{'force-hostname'}[0]; - open (TFILE, ">/var/tmp/$mac_address"); - print TFILE $msg_hash->{'force-hostname'}[0]; - close (TFILE); + open ($TFILE, ">", "/var/tmp/$mac_address"); + print $TFILE $msg_hash->{'force-hostname'}[0]; + close ($TFILE); } else { # $heap->{force-hostname}->{$mac_address}= undef; if ( -e "/var/tmp/$mac_address") { @@ -1081,12 +1082,12 @@ sub server_matches { } else { my $PROC_NET_ROUTE= ('/proc/net/route'); - open(PROC_NET_ROUTE, "<$PROC_NET_ROUTE") + open($FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE") or die "Could not open $PROC_NET_ROUTE"; - my @ifs = ; + my @ifs = <$FD_PROC_NET_ROUTE>; - close(PROC_NET_ROUTE); + close($FD_PROC_NET_ROUTE); # Eat header line shift @ifs;