mirror of
https://github.com/samba-team/samba.git
synced 2025-02-10 13:57:47 +03:00
r16116: Hoist the slow CLOCK_REALTIME message inside the branch so we never
confuse an uninitialised __profile_clock with CLOCK_REALTIME. Flip the condition argument to SMB_WARN around so that it's correct (though completely non-intuitive).
This commit is contained in:
parent
8fc70d0df0
commit
60b5f9618b
@ -150,7 +150,6 @@ static void init_clock_gettime(void)
|
|||||||
DEBUG(10, ("Using CLOCK_MONOTONIC for profile_clock\n"));
|
DEBUG(10, ("Using CLOCK_MONOTONIC for profile_clock\n"));
|
||||||
__profile_clock = CLOCK_MONOTONIC;
|
__profile_clock = CLOCK_MONOTONIC;
|
||||||
have_profiling_clock = True;
|
have_profiling_clock = True;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -162,15 +161,16 @@ static void init_clock_gettime(void)
|
|||||||
clock_gettime(CLOCK_REALTIME, &ts) == 0) {
|
clock_gettime(CLOCK_REALTIME, &ts) == 0) {
|
||||||
__profile_clock = CLOCK_REALTIME;
|
__profile_clock = CLOCK_REALTIME;
|
||||||
have_profiling_clock = True;
|
have_profiling_clock = True;
|
||||||
|
|
||||||
|
SMB_WARN(__profile_clock != CLOCK_REALTIME,
|
||||||
|
("forced to use a slow profiling clock"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SMB_WARN(__profile_clock == CLOCK_REALTIME,
|
|
||||||
("Using (slow) CLOCK_REALTIME for profile_clock"));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SMB_WARN(have_profiling_clock == False,
|
SMB_WARN(have_profiling_clock == True,
|
||||||
("could not find a working clock for profiling"));
|
("could not find a working clock for profiling"));
|
||||||
return have_profiling_clock;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user