From d46a03f0309c53677bca58b5ba09f3495fb91d17 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Mon, 30 Sep 2013 15:44:22 +0200 Subject: [PATCH] guard rtc syscall --- cpu/native/rtc/posix-rtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpu/native/rtc/posix-rtc.c b/cpu/native/rtc/posix-rtc.c index 25f6cdf65f..f2d25c4995 100644 --- a/cpu/native/rtc/posix-rtc.c +++ b/cpu/native/rtc/posix-rtc.c @@ -24,6 +24,7 @@ #include "debug.h" #include "rtc.h" +#include "cpu.h" static int native_rtc_enabled; @@ -58,10 +59,12 @@ void rtc_get_localtime(struct tm *localt) time_t t; if (native_rtc_enabled == 1) { + _native_in_syscall++; t = time(NULL); if (localtime_r(&t, localt) == NULL) { err(1, "rtc_get_localtime: localtime_r"); } + _native_in_syscall--; } }