diff options
Diffstat (limited to 'firmware/target/hosted')
-rw-r--r-- | firmware/target/hosted/rtc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/target/hosted/rtc.c b/firmware/target/hosted/rtc.c index e747aece38..05c8f75ef7 100644 --- a/firmware/target/hosted/rtc.c +++ b/firmware/target/hosted/rtc.c | |||
@@ -54,6 +54,9 @@ int rtc_write_datetime(const struct tm *tm) | |||
54 | tv.tv_sec = mktime((struct tm *)tm); | 54 | tv.tv_sec = mktime((struct tm *)tm); |
55 | tv.tv_usec = 0; | 55 | tv.tv_usec = 0; |
56 | 56 | ||
57 | if ((int)tv.tv_sec == -1) | ||
58 | return -1; | ||
59 | |||
57 | /* set system clock */ | 60 | /* set system clock */ |
58 | settimeofday(&tv, NULL); | 61 | settimeofday(&tv, NULL); |
59 | 62 | ||