mirror of https://github.com/schoebel/mars
main: fix detach during sync when names are changing
This commit is contained in:
parent
ad69d1cf79
commit
a1dc791412
|
@ -1528,6 +1528,13 @@ int __make_copy(
|
|||
for (i = 0; i < 2; i++) {
|
||||
struct mars_brick *aio;
|
||||
|
||||
/* do not change names underway */
|
||||
if (copy && copy->inputs[i] && copy->inputs[i]->connect) {
|
||||
aio = copy->inputs[i]->connect->brick;
|
||||
if (aio && aio->power.button)
|
||||
goto found;
|
||||
}
|
||||
|
||||
cc.argv[i] = argv[i];
|
||||
if (parent) {
|
||||
cc.fullpath[i] = path_make("%s/%s", parent, argv[i]);
|
||||
|
@ -1556,7 +1563,10 @@ int __make_copy(
|
|||
make_msg(msg_pair, "cannot instantiate '%s'", cc.fullpath[i]);
|
||||
goto done;
|
||||
}
|
||||
|
||||
found:
|
||||
cc.output[i] = aio->outputs[0];
|
||||
|
||||
/* When switching off, use a short timeout for aborting.
|
||||
* Important on very slow networks (since a large number
|
||||
* of requests may be pending).
|
||||
|
|
Loading…
Reference in New Issue