diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-09-10 04:00:09 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-09-10 04:00:09 +0000 |
commit | 42edee90bfd597474cebdb932bff113dff4a57bf (patch) | |
tree | f2fa5ba97352d3478d8864cbef23c26a3d4afd74 | |
parent | aab0323d294770f80c6514389e5f84d3abf82429 (diff) | |
download | samba-42edee90bfd597474cebdb932bff113dff4a57bf.tar.gz samba-42edee90bfd597474cebdb932bff113dff4a57bf.tar.bz2 samba-42edee90bfd597474cebdb932bff113dff4a57bf.zip |
fixed a bug in the wins database writer that caused the database to be
written continuously rather than once every 5 seconds (at most).
also changed it to 20 seconds :)
(This used to be commit 1b07de7079e81da9c0b930bdc30ae0451b57d53a)
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 48d27f7bae..1502dd8155 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -1524,9 +1524,11 @@ void initiate_wins_processing(time_t t) if (!lasttime) lasttime = t; - if (t - lasttime < 5) + if (t - lasttime < 20) return; + lasttime = t; + if(!lp_we_are_a_wins_server()) return; @@ -1541,17 +1543,23 @@ void initiate_wins_processing(time_t t) /******************************************************************* Write out the current WINS database. ******************************************************************/ - void wins_write_database(void) { struct name_record *namerec; pstring fname, fnamenew; - + static int child_pid; + FILE *fp; if(!lp_we_are_a_wins_server()) return; + /* we will do the writing in a child process to ensure that the parent + doesn't block while this is done */ + if ((child_pid=fork())) { + return; + } + pstrcpy(fname,lp_lockdir()); trim_string(fname,NULL,"/"); pstrcat(fname,"/"); |