Commit 647f23fb authored by Aurelio Colosimo's avatar Aurelio Colosimo

fix compilation of arch-gnu-linux

To be tested when merging into master
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent c7f9b1cc
......@@ -10,6 +10,7 @@
#include <string.h>
#include <errno.h>
#define CONFIG_PPSI_RUNTIME_VERBOSITY 1
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "posix.h"
......
......@@ -45,8 +45,8 @@ int posix_timer_start(uint32_t interval_ms, struct pp_timer *tm)
{
struct timespec now;
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
tm->start = ((uint64_t)(now->tv_sec)) * 1000 +
(now->tv_nsec / 1000000);
tm->start = ((uint64_t)(now.tv_sec)) * 1000 +
(now.tv_nsec / 1000000);
tm->interval_ms = interval_ms;
return 0;
......@@ -71,11 +71,11 @@ int posix_timer_expired(struct pp_timer *tm)
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
now_ms = ((uint64_t)(now->tv_sec)) * 1000 +
(now->tv_nsec / 1000000);
now_ms = ((uint64_t)(now.tv_sec)) * 1000 +
(now.tv_nsec / 1000000);
if (now_ms > tm->start + tm->interval) {
tm->start = now;
if (now_ms > tm->start + tm->interval_ms) {
tm->start = now_ms;
return 1;
}
......
......@@ -2,6 +2,7 @@
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
*/
#define CONFIG_PPSI_RUNTIME_VERBOSITY 1
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment