From 1f4ad10dff9d34cefcbec2235110496d44be6163 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 2 Jun 2023 11:50:09 +0200 Subject: [PATCH] fixing merge --- src/fsfw/osal/linux/Clock.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/fsfw/osal/linux/Clock.cpp b/src/fsfw/osal/linux/Clock.cpp index 63406b7c2..28be12477 100644 --- a/src/fsfw/osal/linux/Clock.cpp +++ b/src/fsfw/osal/linux/Clock.cpp @@ -33,27 +33,22 @@ ReturnValue_t Clock::getClock_timeval(timeval* time) { return returnvalue::OK; } + + timeval Clock::getUptime() { timeval uptime{}; - auto result = getUptime(&uptime); - if (result != returnvalue::OK) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "Clock::getUptime: Error getting uptime" << std::endl; -#endif - } - return uptime; -} -ReturnValue_t Clock::getUptime(timeval* uptime) { double uptimeSeconds; std::ifstream ifile("/proc/uptime"); if (ifile.bad()) { - return returnvalue::FAILED; +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "Clock::getUptime: Error getting uptime" << std::endl; +#endif + return uptime; } if (ifile >> uptimeSeconds) { uptime->tv_sec = uptimeSeconds; uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6); - return returnvalue::OK; } - return returnvalue::FAILED; -} \ No newline at end of file + return uptime; +}