From fdb124c1cd0e91fa2a5f1c993a1df12fb866cca9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 27 Jun 1998 01:07:30 +0000 Subject: Added code to do elections when told to do so. Jeremy. (This used to be commit a38d903d2016202d470f1405e593be3c20404d72) --- source3/nmbd/nmbd_elections.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source3/nmbd/nmbd_elections.c b/source3/nmbd/nmbd_elections.c index 4be5b73508..ceef961d5e 100644 --- a/source3/nmbd/nmbd_elections.c +++ b/source3/nmbd/nmbd_elections.c @@ -348,8 +348,15 @@ BOOL check_elections(void) { run_any_election |= work->RunningElection; - /* Only start an election if we are in the potential browser state. */ - if (work->needelection && !work->RunningElection && AM_POTENTIAL_MASTER_BROWSER(work)) + /* + * Start an election if we have any chance of winning. + * Note this is a change to the previous code, that would + * only run an election if nmbd was in the potential browser + * state. We need to run elections in any state if we're told + * to. JRA. + */ + + if (work->needelection && !work->RunningElection && lp_local_master()) { /* * We can only run an election for a workgroup if we have -- cgit