1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #271 from mehlis/master

fix wrong error handling introduced in 945aef
This commit is contained in:
Christian Mehlis 2013-10-26 07:15:40 -07:00
commit 6ebe1bfdc7

View File

@ -73,12 +73,10 @@ time_t rtc_time(struct timeval *time)
{ {
if (native_rtc_enabled == 1) { if (native_rtc_enabled == 1) {
_native_in_syscall++; _native_in_syscall++;
if (gettimeofday(time, 0) == 0) { if (gettimeofday(time, NULL) == -1) {
errx(1, "rtc_time: gettimeofday: error"); err(1, "rtc_time: gettimeofday");
} }
_native_in_syscall--; _native_in_syscall--;
} }
return time->tv_sec; return time->tv_sec;
} }