fix #1819: fork_worker: ensure sync'ed workers control terminal
[pve-common.git] / src / PVE / CalendarEvent.pm
index c30686d..3c08eb0 100644 (file)
@@ -27,7 +27,7 @@ sub pve_verify_calendar_event {
     eval { parse_calendar_event($text); };
     if (my $err = $@) {
        return undef if $noerr;
-       die "invalid calendar event '$text'\n";
+       die "invalid calendar event '$text' - $err\n";
     }
     return $text;
 }
@@ -177,9 +177,13 @@ sub compute_next_event {
 
        if ($utc) {
            (undef, $min, $hour, $mday, $mon, $year, $wday) = gmtime($last);
+           # gmtime and timegm interpret two-digit years differently
+           $year += 1900;
            $startofday = timegm(0, 0, 0, $mday, $mon, $year);
        } else {
            (undef, $min, $hour, $mday, $mon, $year, $wday) = localtime($last);
+           # localtime and timelocal interpret two-digit years differently
+           $year += 1900;
            $startofday = timelocal(0, 0, 0, $mday, $mon, $year);
        }