summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Brandner <simon.brandner@partner.bmw.de>2012-12-18 10:47:48 +0100
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2013-07-19 16:54:12 +0200
commita90c37bddb39572687d12d75e3ce5a5e8ecd6a71 (patch)
treeb8fcb4d9c7f40e2102e5234b72f9435015f15b32 /src
parent04de575f6d827857ae6eae3e86fdf71ef7e165d7 (diff)
downloadDLT-daemon-a90c37bddb39572687d12d75e3ce5a5e8ecd6a71.tar.gz
fix overflow after ~35 minutes in dlt_uptime function. Should now ocurr after >100 hrs
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/shared/dlt_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index b2324b1..3e7e498 100755
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -3077,8 +3077,8 @@ uint32_t dlt_uptime(void)
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC,&ts)==0)
- {
- return (uint32_t)((((ts.tv_sec*1000000)+(ts.tv_nsec/1000)))/100); // in 0.1 ms = 100 us
+ {
+ return ( (uint32_t)ts.tv_sec*10000 + (uint32_t)ts.tv_nsec/100000 );// in 0.1 ms = 100 us
}
else
{