Skip to content

Commit

Permalink
chore(utils): actually check for CLOCK_BOOTTIME.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP committed Sep 10, 2022
1 parent 51dc7c5 commit 38ef569
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/utils/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

void fetch_ms(uint64_t *val, uint64_t *ctr) {
struct timespec spec;
#ifdef __linux__
#ifdef CLOCK_BOOTTIME
clock_gettime(CLOCK_BOOTTIME, &spec);
#else
#else
clock_gettime(CLOCK_MONOTONIC, &spec);
#endif
#endif
*val = spec.tv_sec * 1000 + spec.tv_nsec / 1000000;

if (ctr) {
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

- [ ] Improve logging: per-namespace -> LIBMODULE_MOD_LOG="debug" LIBMODULE_CTX_LOG="debug"; LIBMODULE_LOG="debug" remains to enable all debugs
- [ ] Drop log noop functions and use normal checks
- [ ] move logging to liblog and install public API

### Srcs

Expand Down

0 comments on commit 38ef569

Please sign in to comment.