summaryrefslogtreecommitdiffstats
path: root/source3/profile
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-06-09 10:50:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:21 -0500
commitc12c557a13ad5e26e1c3c8a7e46f3e096b7f6479 (patch)
tree40a607dc7d425c138879f0d3c97bc5437bb2186f /source3/profile
parentbf7a5433b4da564c5298e856cdd46383b8998bb2 (diff)
downloadsamba-c12c557a13ad5e26e1c3c8a7e46f3e096b7f6479.tar.gz
samba-c12c557a13ad5e26e1c3c8a7e46f3e096b7f6479.tar.xz
samba-c12c557a13ad5e26e1c3c8a7e46f3e096b7f6479.zip
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 used to be commit 60b5f9618b77afb397f96c1ff406c8cd3a4648f3)
Diffstat (limited to 'source3/profile')
-rw-r--r--source3/profile/profile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/profile/profile.c b/source3/profile/profile.c
index b0db629682..c3512ec01d 100644
--- a/source3/profile/profile.c
+++ b/source3/profile/profile.c
@@ -150,7 +150,6 @@ static void init_clock_gettime(void)
DEBUG(10, ("Using CLOCK_MONOTONIC for profile_clock\n"));
__profile_clock = CLOCK_MONOTONIC;
have_profiling_clock = True;
- return;
}
#endif
@@ -162,15 +161,16 @@ static void init_clock_gettime(void)
clock_gettime(CLOCK_REALTIME, &ts) == 0) {
__profile_clock = CLOCK_REALTIME;
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
- SMB_WARN(have_profiling_clock == False,
+ SMB_WARN(have_profiling_clock == True,
("could not find a working clock for profiling"));
- return have_profiling_clock;
+ return;
}
#endif