--- loncom/lonnet/perl/lonnet.pm 2004/11/06 20:53:40 1.523.2.10 +++ loncom/lonnet/perl/lonnet.pm 2004/11/06 21:27:40 1.523.2.12 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.523.2.10 2004/11/06 20:53:40 albertel Exp $ +# $Id: lonnet.pm,v 1.523.2.12 2004/11/06 21:27:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ qw(%perlvar %hostname %homecache %badSer %courselogs %accesshash %userrolehash $processmarker $dumpcount %coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseresdatacache %userresdatacache %usectioncache %domaindescription %domain_auth_def %domain_auth_arg_def - %domain_lang_def %domain_city %domain_longi %domain_lati $tmpdir); + %domain_lang_def %domain_city %domain_longi %domain_lati $tmpdir $_64bit); use IO::Socket; use GDBM_File; @@ -52,7 +52,6 @@ use Apache::lonlocal; use Storable qw(lock_store lock_nstore lock_retrieve freeze thaw); use Time::HiRes qw( gettimeofday tv_interval ); my $readit; -my $_64bit=0; =pod @@ -4732,7 +4731,7 @@ sub numval { $txt=~tr/U-Z/0-5/; $txt=~tr/u-z/0-5/; $txt=~s/\D//g; - if ($_64bit) { if ($total > 2**32) { return -1; } } + if ($_64bit) { if ($txt > 2**32) { return -1; } } return int($txt); } @@ -4837,8 +4836,7 @@ sub rndseed_64bit { my $num2=$nameseed+$domainseed+$courseseed; #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); #&Apache::lonxml::debug("rndseed :$num:$symb"); - if ($_64bit) { $num1=(($num1<<32)>>32); } - if ($_64bit) { $num2=(($num2<<32)>>32); } + if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); } return "$num1,$num2"; } } @@ -4861,8 +4859,7 @@ sub rndseed_64bit2 { my $num2=$nameseed+$domainseed+$courseseed; #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); #&Apache::lonxml::debug("rndseed :$num:$symb"); - if ($_64bit) { $num1=(($num1<<32)>>32); } - if ($_64bit) { $num2=(($num2<<32)>>32); } + if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); } return "$num1,$num2"; } } @@ -4884,9 +4881,9 @@ sub rndseed_64bit3 { my $num1=$symbchck+$symbseed+$namechck; my $num2=$nameseed+$domainseed+$courseseed; #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); - #&Apache::lonxml::debug("rndseed :$num:$symb"); - if ($_64bit) { $num1=(($num1<<32)>>32); } - if ($_64bit) { $num2=(($num2<<32)>>32); } + #&Apache::lonxml::debug("rndseed :$num1:$num2:$_64bit"); + if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); } + return "$num1:$num2"; } } @@ -5247,11 +5244,6 @@ sub goodbye { } BEGIN { - { - use integer; - my $test=(2**32)+1; - if ($test != 0) { $_64bit=1; } - } # ----------------------------------- Read loncapa.conf and loncapa_apache.conf unless ($readit) { { @@ -5402,6 +5394,12 @@ $dumpcount=0; &logtouch(); &logthis('INFO: Read configuration'); $readit=1; + { + use integer; + my $test=(2**32)+1; + if ($test != 0) { $_64bit=1; } + &logthis(" Detected 64bit platform ($_64bit)"); + } } }