]> err.no Git - util-linux/commitdiff
hwclock: read_hardware_clock_rtc() need to return error codes
authorKarel Zak <kzak@redhat.com>
Wed, 13 Aug 2008 09:47:10 +0000 (11:47 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 13 Aug 2008 09:47:10 +0000 (11:47 +0200)
We shouldn't ignore RTC_RD_TIME/RTCGET error codes.

Signed-off-by: Karel Zak <kzak@redhat.com>
hwclock/rtc.c

index e59414fde13d940b7aee5b5dfc9f22d54c0cc9fc..7ec5362e898eba8e665af7410bdb398c0c1dc943 100644 (file)
@@ -295,15 +295,15 @@ int ret;
 
 static int
 read_hardware_clock_rtc(struct tm *tm) {
-       int rtc_fd;
+       int rtc_fd, rc;
 
        rtc_fd = open_rtc_or_exit();
 
        /* Read the RTC time/date, return answer via tm */
-       do_rtc_read_ioctl(rtc_fd, tm);
+       rc = do_rtc_read_ioctl(rtc_fd, tm);
 
        close(rtc_fd);
-       return 0;
+       return rc;
 }