Check some more ioctl() calls for errors

This commit is contained in:
sin 2014-06-28 11:28:19 +01:00
parent debcf4447d
commit 88c61c17e8
2 changed files with 4 additions and 3 deletions

1
TODO
View File

@ -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.

View File

@ -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