[SCM] Samba Shared Repository - branch v3-6-test updated
Björn Jacke
bjacke at samba.org
Mon Sep 13 04:54:09 MDT 2010
The branch, v3-6-test has been updated
via 02a8a96 s3/winbind: use mono time for startup timeout check
via b7fcbb2 libreplace: clock_gettime sets errno
from dde50b4 Add check missing from previous patch after talloc_strdup().
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit 02a8a96fd878542099644f84ad245a333124f97a
Author: Björn Jacke <bj at sernet.de>
Date: Fri Sep 10 21:36:20 2010 +0200
s3/winbind: use mono time for startup timeout check
commit b7fcbb2955689b59822365593d2431f7f4bb5e34
Author: Björn Jacke <bj at sernet.de>
Date: Fri Sep 10 21:03:17 2010 +0200
libreplace: clock_gettime sets errno
-----------------------------------------------------------------------
Summary of changes:
lib/replace/replace.c | 3 ++-
source3/winbindd/winbindd.h | 2 +-
source3/winbindd/winbindd_cm.c | 4 ++--
source3/winbindd/winbindd_dual.c | 6 +++---
4 files changed, 8 insertions(+), 7 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index f3459dd..a00f705 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -776,7 +776,8 @@ int rep_clock_gettime(clockid_t clk_id, struct timespec *tp)
tp->tv_nsec = tval.tv_usec * 1000;
break;
default:
- return EINVAL;
+ errno = EINVAL;
+ return -1;
}
return 0;
}
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 77aab85..68dabfe 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -155,7 +155,7 @@ struct winbindd_domain {
bool primary; /* is this our primary domain ? */
bool internal; /* BUILTIN and member SAM */
bool online; /* is this domain available ? */
- time_t startup_time; /* When we set "startup" true. */
+ time_t startup_time; /* When we set "startup" true. monotonic clock */
bool startup; /* are we in the first 30 seconds after startup_time ? */
bool can_do_samlogon_ex; /* Due to the lack of finer control what type
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index fca0a91..8f95031 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -291,7 +291,7 @@ static void check_domain_online_handler(struct event_context *ctx,
/* Are we still in "startup" mode ? */
- if (domain->startup && (now.tv_sec > domain->startup_time + 30)) {
+ if (domain->startup && (time_mono(NULL) > domain->startup_time + 30)) {
/* No longer in "startup" mode. */
DEBUG(10,("check_domain_online_handler: domain %s no longer in 'startup' mode.\n",
domain->name ));
@@ -508,7 +508,7 @@ void set_domain_online_request(struct winbindd_domain *domain)
GetTimeOfDay(&tev);
/* Go into "startup" mode again. */
- domain->startup_time = tev.tv_sec;
+ domain->startup_time = time_mono(NULL);
domain->startup = True;
tev.tv_sec += 5;
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index f78ae2d..4cec7c2 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1306,7 +1306,7 @@ static bool fork_domain_child(struct winbindd_child *child)
* try to bring domain online after fork. */
if ( child->domain ) {
child->domain->startup = True;
- child->domain->startup_time = time(NULL);
+ child->domain->startup_time = time_mono(NULL);
/* we can be in primary domain or in trusted domain
* If we are in trusted domain, set the primary domain
* in start-up mode */
@@ -1314,7 +1314,7 @@ static bool fork_domain_child(struct winbindd_child *child)
set_domain_online_request(child->domain);
if (!(child->domain->primary)) {
primary_domain->startup = True;
- primary_domain->startup_time = time(NULL);
+ primary_domain->startup_time = time_mono(NULL);
set_domain_online_request(primary_domain);
}
}
@@ -1389,7 +1389,7 @@ static bool fork_domain_child(struct winbindd_child *child)
GetTimeOfDay(&now);
if (child->domain && child->domain->startup &&
- (now.tv_sec > child->domain->startup_time + 30)) {
+ (time_mono(NULL) > child->domain->startup_time + 30)) {
/* No longer in "startup" mode. */
DEBUG(10,("fork_domain_child: domain %s no longer in 'startup' mode.\n",
child->domain->name ));
--
Samba Shared Repository
More information about the samba-cvs
mailing list