From 8781e4d787763a6b50d7b3819b33ace208ff7784 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Oct 1996 01:56:21 +0000 Subject: - changed the default nmbd loop timout to 10 seconds (2 seconds was much too short) - got rid of many unnecessary calls to time(NULL) in nmbd. They were causing it to chew too much CPU time when idle. Now we pass a time value in from the top level. (This used to be commit 3cd7303dbc2118db7084a6d8872403d825c52323) --- source3/nameannounce.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/nameannounce.c') diff --git a/source3/nameannounce.c b/source3/nameannounce.c index fec8895510..1dadc0132c 100644 --- a/source3/nameannounce.c +++ b/source3/nameannounce.c @@ -292,9 +292,8 @@ void announce_server(struct subnet_record *d, struct work_record *work, /**************************************************************************** construct a host announcement unicast **************************************************************************/ -void announce_host(void) +void announce_host(time_t t) { - time_t t = time(NULL); struct subnet_record *d; pstring comment; char *my_name; @@ -368,11 +367,10 @@ void announce_host(void) NAME_QUERY_DOM_SRV_CHK command, if there is a response from the name query initiated here. see response_name_query() **************************************************************************/ -void announce_master(void) +void announce_master(time_t t) { struct subnet_record *d; static time_t last=0; - time_t t = time(NULL); BOOL am_master = False; /* are we a master of some sort? :-) */ if (!last) last = t; @@ -477,11 +475,10 @@ void announce_master(void) on a remote browse list. They are done blind, no checking is done to see if there is actually a browse master at the other end. **************************************************************************/ -void announce_remote(void) +void announce_remote(time_t t) { char *s,*ptr; static time_t last_time = 0; - time_t t = time(NULL); pstring s2; struct in_addr addr; char *comment,*workgroup; -- cgit