From 6791fd18ccd1a10060c59bfbf8ee72ec42834a9a Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Tue, 13 Jan 2015 17:38:04 +0100 Subject: [PATCH] vbox: use libc's 'gettimeofday()' function Fixes #1363 --- repos/ports/run/virtualbox.run | 4 ++-- repos/ports/run/virtualbox_auto_disk.run | 4 ++-- repos/ports/run/virtualbox_auto_share.run | 4 ++-- repos/ports/src/virtualbox/libc.cc | 19 ------------------- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/repos/ports/run/virtualbox.run b/repos/ports/run/virtualbox.run index 415ec28bc..1aaf9ba37 100644 --- a/repos/ports/run/virtualbox.run +++ b/repos/ports/run/virtualbox.run @@ -111,9 +111,9 @@ append config { - + - } + } append_if [expr $use_serial] config { } diff --git a/repos/ports/run/virtualbox_auto_disk.run b/repos/ports/run/virtualbox_auto_disk.run index 20287a173..f4642e0b9 100644 --- a/repos/ports/run/virtualbox_auto_disk.run +++ b/repos/ports/run/virtualbox_auto_disk.run @@ -18,14 +18,14 @@ set config_of_app { - + } append_if [expr $use_ram_fs] config_of_app { } append config_of_app { - + diff --git a/repos/ports/run/virtualbox_auto_share.run b/repos/ports/run/virtualbox_auto_share.run index 85f0bd8c1..3c8628e5d 100644 --- a/repos/ports/run/virtualbox_auto_share.run +++ b/repos/ports/run/virtualbox_auto_share.run @@ -187,9 +187,9 @@ set config_of_app { - + - + } append_if [expr $use_ram_fs] config_of_app { diff --git a/repos/ports/src/virtualbox/libc.cc b/repos/ports/src/virtualbox/libc.cc index 6a901ecff..0d1019ff4 100644 --- a/repos/ports/src/virtualbox/libc.cc +++ b/repos/ports/src/virtualbox/libc.cc @@ -143,25 +143,6 @@ extern "C" int sigaction(int signum, const struct sigaction *act, } -/** - * Used by RTTimeNow - */ -extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - if (!tv) - return -1; - - try { - static Rtc::Connection rtc; - /* we need only seconds, current_time in microseconds */ - tv->tv_sec = rtc.get_current_time() / 1000000ULL; - tv->tv_usec = rtc.get_current_time() % 1000000ULL * 1000; - return 0; - } catch (...) { - return -1; - } -} - /* our libc provides a _nanosleep function */ extern "C" int _nanosleep(const struct timespec *req, struct timespec *rem); extern "C" int nanosleep(const struct timespec *req, struct timespec *rem)