# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1217575389 0
# Node ID ca00393c8ca62fbaae04b8b31b3a2b6bbd08689c
# Parent  03d9640c9ce4043c5b3034868e77b2fcc0e85082
Fixed reconfiguration: Force config when application detaches.

diff -r 03d9640c9ce4 -r ca00393c8ca6 master/master.c
--- a/master/master.c	Fri Aug 01 07:22:13 2008 +0000
+++ b/master/master.c	Fri Aug 01 07:23:09 2008 +0000
@@ -503,12 +503,19 @@
     ec_master_clear_slave_configs(master);
     up(&master->master_sem);
 
-    // set states for all slaves
     for (slave = master->slaves;
             slave < master->slaves + master->slave_count;
             slave++) {
+
+        // set states for all slaves
         ec_slave_request_state(slave, EC_SLAVE_STATE_PREOP);
-    }
+
+        // mark for reconfiguration, because the master could have no
+        // possibility for a reconfiguration between two sequential operation
+        // phases.
+        slave->force_config = 1;
+    }
+
 #ifdef EC_EOE
     // ... but leave EoE slaves in OP
     list_for_each_entry(eoe, &master->eoe_handlers, list) {
diff -r 03d9640c9ce4 -r ca00393c8ca6 master/slave_config.c
--- a/master/slave_config.c	Fri Aug 01 07:22:13 2008 +0000
+++ b/master/slave_config.c	Fri Aug 01 07:23:09 2008 +0000
@@ -208,10 +208,6 @@
 	slave->config = sc;
 	sc->slave = slave;
 
-    // force reconfiguration, because the master could have had no possibility
-    // for a reconfiguration, between two operation phases.
-    slave->force_config = 1;
-
     ec_slave_request_state(slave, EC_SLAVE_STATE_OP);
 
     if (sc->master->debug_level)