Check some more ioctl() calls for errors
This commit is contained in:
parent
debcf4447d
commit
88c61c17e8
1
TODO
1
TODO
@ -27,6 +27,5 @@ Tools to be implemented
|
||||
Misc
|
||||
====
|
||||
|
||||
* Check all ioctl() calls for failure.
|
||||
* Decide what to do with 'bool vs int' debate.
|
||||
* Beautify passwd(1) + shadow support.
|
||||
|
@ -76,7 +76,8 @@ readrtctm(struct tm *tm, int fd)
|
||||
struct rtc_time rt;
|
||||
|
||||
memset(&rt, 0, sizeof(rt));
|
||||
ioctl(fd, RTC_RD_TIME, &rt);
|
||||
if (ioctl(fd, RTC_RD_TIME, &rt) < 0)
|
||||
eprintf("RTC_RD_TIME:");
|
||||
tm->tm_sec = rt.tm_sec;
|
||||
tm->tm_min = rt.tm_min;
|
||||
tm->tm_hour = rt.tm_hour;
|
||||
@ -102,7 +103,8 @@ writertctm(struct tm *tm, int fd)
|
||||
rt.tm_wday = tm->tm_wday;
|
||||
rt.tm_yday = tm->tm_yday;
|
||||
rt.tm_isdst = tm->tm_isdst;
|
||||
ioctl(fd, RTC_SET_TIME, &rt);
|
||||
if (ioctl(fd, RTC_SET_TIME, &rt) < 0)
|
||||
eprintf("RTC_SET_TIME:");
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user