X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ftimedate%2Ftimedated.c;h=3d450ca3fabdc8dbe3a62bcd5f0c544d72fe75c2;hp=809c80bad11297acc1fdd6342f79d05f542fef97;hb=88e262b667df1cd9873c45f0062ae79735f41ae6;hpb=29f8d1f21ab5341361adcc2533fcda24a7fcf490 diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 809c80bad..3d450ca3f 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -467,12 +467,14 @@ static int property_get_rtc_time( zero(tm); r = hwclock_get_time(&tm); - if (r < 0) { + if (r == -EBUSY) { + log_warning("/dev/rtc is busy, is somebody keeping it open continously? That's not a good idea... Returning a bogus RTC timestamp."); + t = 0; + } else if (r < 0) { sd_bus_error_set_errnof(error, -r, "Failed to read RTC: %s", strerror(-r)); return r; - } - - t = (usec_t) mktime(&tm) * USEC_PER_SEC; + } else + t = (usec_t) mktime(&tm) * USEC_PER_SEC; r = sd_bus_message_append(reply, "t", t); if (r < 0)