summaryrefslogtreecommitdiff
path: root/source/nmbd/nmbd_elections.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-27 01:07:30 +0000
committerJeremy Allison <jra@samba.org>1998-06-27 01:07:30 +0000
commita38d903d2016202d470f1405e593be3c20404d72 (patch)
treed2a74f2c64d0bfc4f27fc1285bc6edbb9e4a4979 /source/nmbd/nmbd_elections.c
parent1fcb094ba04f01be1261ac92198c25b21b0d5ad5 (diff)
downloadsamba-a38d903d2016202d470f1405e593be3c20404d72.tar.gz
Added code to do elections when told to do so.
Jeremy.
Diffstat (limited to 'source/nmbd/nmbd_elections.c')
-rw-r--r--source/nmbd/nmbd_elections.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/nmbd/nmbd_elections.c b/source/nmbd/nmbd_elections.c
index 4be5b735088..ceef961d5e9 100644
--- a/source/nmbd/nmbd_elections.c
+++ b/source/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