[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 10 Nov 2006 18:44:34 -0000


albertel		Fri Nov 10 13:44:34 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - stop the 64bit2 rnd generator from just crashing on 64bit machines
    (BUG#5064)
  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.802 loncom/lonnet/perl/lonnet.pm:1.803
--- loncom/lonnet/perl/lonnet.pm:1.802	Thu Nov  9 21:04:31 2006
+++ loncom/lonnet/perl/lonnet.pm	Fri Nov 10 13:44:34 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.802 2006/11/10 02:04:31 raeburn Exp $
+# $Id: lonnet.pm,v 1.803 2006/11/10 18:44:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6607,6 +6607,7 @@
     if (!$domain) { $domain=$wdomain; }
     if (!$username) { $username=$wusername }
     my $which=&get_rand_alg();
+
     if (defined(&getCODE())) {
 	if ($which eq '64bit5') {
 	    return &rndseed_CODE_64bit5($symb,$courseid,$domain,$username);
@@ -6664,7 +6665,6 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num:$symb");
 	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
-	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
 	return "$num1,$num2";
     }
 }
@@ -6687,6 +6687,7 @@
 	my $num2=$nameseed+$domainseed+$courseseed;
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num:$symb");
+	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
 	return "$num1,$num2";
     }
 }