[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Mon Jun 6 04:59:02 MDT 2011


The branch, master has been updated
       via  81e48df s4/server: simplify and replace bad portable gettimeofday by time
       via  4778d35 s3/pthreadpool: replace bad portable gettimeofday by clock_gettime
      from  b9108ca s3-s4-param: Add hooks for parametric options in the s3/s4 glue layer

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 81e48dfa35e1b4df6cf46df74572a2ace81c1b84
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Jun 5 21:32:11 2011 +0200

    s4/server: simplify and replace bad portable gettimeofday by time
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User: Björn Jacke <bj at sernet.de>
    Autobuild-Date: Mon Jun  6 12:58:26 CEST 2011 on sn-devel-104

commit 4778d35c34031f7724379ac2d3b554af4adc48dc
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Jun 5 21:30:16 2011 +0200

    s3/pthreadpool: replace bad portable gettimeofday by clock_gettime
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/pthreadpool/pthreadpool.c |    6 ++----
 source4/smbd/server.c                 |   17 ++---------------
 2 files changed, 4 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index 7538fb7..9981ed2 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -427,7 +427,6 @@ static void *pthreadpool_server(void *arg)
 	}
 
 	while (1) {
-		struct timeval tv;
 		struct timespec ts;
 		struct pthreadpool_job *job;
 
@@ -436,9 +435,8 @@ static void *pthreadpool_server(void *arg)
 		 * time, exit this thread.
 		 */
 
-		gettimeofday(&tv, NULL);
-		ts.tv_sec = tv.tv_sec + 1;
-		ts.tv_nsec = tv.tv_usec*1000;
+		clock_gettime(CLOCK_REALTIME, &ts);
+		ts.tv_sec += 1;
 
 		while ((pool->jobs == NULL) && (pool->shutdown == 0)) {
 
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 53dc20d..6acccd1 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -178,13 +178,7 @@ _NORETURN_ static void max_runtime_handler(struct tevent_context *ev,
 					   struct timeval t, void *private_data)
 {
 	const char *binary_name = (const char *)private_data;
-	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));
-	}
+	DEBUG(0,("%s: maximum runtime exceeded - terminating, current ts: %d\n", binary_name, time(NULL)));
 	exit(0);
 }
 
@@ -444,14 +438,7 @@ 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));
-		}
+		DEBUG(0,("Called with maxruntime %d - current ts %d\n", max_runtime, time(NULL)));
 		tevent_add_timer(event_ctx, event_ctx,
 				 timeval_current_ofs(max_runtime, 0),
 				 max_runtime_handler,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list