[pve-devel] r6515 - pve-manager/pve2/bin

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Aug 22 10:34:31 CEST 2011


Author: dietmar
Date: 2011-08-22 10:34:31 +0200 (Mon, 22 Aug 2011)
New Revision: 6515

Modified:
   pve-manager/pve2/bin/pvestatd
Log:

protect against time wrap


Modified: pve-manager/pve2/bin/pvestatd
===================================================================
--- pve-manager/pve2/bin/pvestatd	2011-08-22 06:15:43 UTC (rev 6514)
+++ pve-manager/pve2/bin/pvestatd	2011-08-22 08:34:31 UTC (rev 6515)
@@ -306,7 +306,10 @@
 	    restart_server ();
 	}
 
-	while (time < $next_update && !$reload_config) { sleep (1); };
+	my $wcount = 0;
+	while ((time() < $next_update) && 
+	       ($wcount < $updatetime) && # protect against time wrap
+	       !$reload_config) { $wcount++; sleep (1); };
     };
 
     my $err = $@;




More information about the pve-devel mailing list