summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-11-27 13:00:57 +0300
committerMatthieu Patou <mat@samba.org>2010-11-27 11:51:12 +0100
commit6a781b52867900bc6085721fd0e2ededa4f98f50 (patch)
tree0b29f9187634e8a51f9058e4ff4b823d461bbc73
parentd237698850f00325346335b53cfe31657026b940 (diff)
downloadsamba-6a781b52867900bc6085721fd0e2ededa4f98f50.tar.gz
samba-6a781b52867900bc6085721fd0e2ededa4f98f50.tar.bz2
samba-6a781b52867900bc6085721fd0e2ededa4f98f50.zip
Add timestamp when running with --maximum-runtime
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Sat Nov 27 11:51:12 CET 2010 on sn-devel-104
-rw-r--r--source4/smbd/server.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 29deb85921..1c6a11d950 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -178,7 +178,13 @@ _NORETURN_ static void max_runtime_handler(struct tevent_context *ev,
struct timeval t, void *private_data)
{
const char *binary_name = (const char *)private_data;
- DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
+ struct timeval tv;
+ struct timezone tz;
+ if (gettimeofday(&tv, &tz) == 0) {
+ DEBUG(0,("%s: maximum runtime exceeded - terminating, current ts: %d\n", binary_name, (int)tv.tv_sec));
+ } else {
+ DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
+ }
exit(0);
}
@@ -438,6 +444,14 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
discard_const(binary_name));
if (max_runtime) {
+ struct timeval tv;
+ struct timezone tz;
+
+ if (gettimeofday(&tv, &tz) == 0) {
+ DEBUG(0,("Called with maxruntime %d - current ts %d\n", max_runtime, (int)tv.tv_sec));
+ } else {
+ DEBUG(0,("Called with maxruntime %d\n", max_runtime));
+ }
tevent_add_timer(event_ctx, event_ctx,
timeval_current_ofs(max_runtime, 0),
max_runtime_handler,