+#
+# Compare function for host sort. Hosts with errors go first,
+# sorted with the oldest errors first. The remaining hosts
+# are sorted so that those with the oldest backups go first.
+#
+sub HostSortCompare
+{
+ return -1 if ( $Status{$a}{error} ne "" && $Status{$b}{error} eq "" );
+ return 1 if ( $Status{$a}{error} eq "" && $Status{$b}{error} ne "" );
+ return $Status{$a}{endTime} <=> $Status{$b}{endTime};
+}
+