diff --git a/kernel/sy_old/mars_main.c b/kernel/sy_old/mars_main.c index bf6a2aa8..63a1fc1a 100644 --- a/kernel/sy_old/mars_main.c +++ b/kernel/sy_old/mars_main.c @@ -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).