[pve-devel] [PATCH guest-common] replication: sort time stamps numerically

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jun 28 09:02:29 CEST 2017


---
 PVE/ReplicationState.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/ReplicationState.pm b/PVE/ReplicationState.pm
index b817f08..74c95f9 100644
--- a/PVE/ReplicationState.pm
+++ b/PVE/ReplicationState.pm
@@ -299,7 +299,7 @@ sub get_next_job {
 	my $jobb = $jobs->{$b};
 	my $sa =  $joba->{state};
 	my $sb =  $jobb->{state};
-	my $res = $sa->{last_iteration} cmp $sb->{last_iteration};
+	my $res = $sa->{last_iteration} <=> $sb->{last_iteration};
 	return $res if $res != 0;
 	$res = $joba->{next_sync} <=> $jobb->{next_sync};
 	return $res if $res != 0;
-- 
2.11.0





More information about the pve-devel mailing list