main: fix detach during sync when names are changing

This commit is contained in:
Thomas Schoebel-Theuer 2019-02-06 07:21:04 +01:00 committed by Thomas Schoebel-Theuer
parent ad69d1cf79
commit a1dc791412
1 changed files with 10 additions and 0 deletions

View File

@ -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).