Skip to content

Commit

Permalink
Honor fake_monotoic_clock setting in clock_nanosleep, addresses wolfc…
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfcw committed Jun 4, 2023
1 parent 7df1bf7 commit d17bb11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libfaketime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,9 @@ int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, s
}
else if (clock_id == CLOCK_MONOTONIC)
{
timespecadd(&ftpl_starttime.mon, &tdiff, &real_req);
if (fake_monotonic_clock) {
timespecadd(&ftpl_starttime.mon, &tdiff, &real_req);
}
}
else /* presumably only CLOCK_PROCESS_CPUTIME_ID, leave untouched */
{
Expand Down

0 comments on commit d17bb11

Please sign in to comment.