Fixed reconfiguration: Force config when application detaches.
authorFlorian Pose <fp@igh-essen.com>
Fri, 01 Aug 2008 07:23:09 +0000
changeset 1178 ca00393c8ca6
parent 1177 03d9640c9ce4
child 1179 c0e6adec1aee
Fixed reconfiguration: Force config when application detaches.
master/master.c
master/slave_config.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) {
--- 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)