diff options
author | Yabin Cui <yabinc@google.com> | 2015-07-24 18:17:16 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2015-07-24 18:17:16 -0700 |
commit | ee530065648d7fdf1bb80c76385cc54a6d661dc8 (patch) | |
tree | 84f77ac82af9bf8472f6b4507093b5d22290f2b5 /init/signal_handler.cpp | |
parent | 00ede7d2626f9343d330dc6f5286bba3e99e41d0 (diff) |
init: expand_props for onrestart commands.
It is only a temporary fix. I hope the code can be moved into a member
function of class Command.
Bug: 22654233
Change-Id: I38c24fb624e54986a953f44d398b3b80c3795d24
Diffstat (limited to 'init/signal_handler.cpp')
-rw-r--r-- | init/signal_handler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/init/signal_handler.cpp b/init/signal_handler.cpp index 39a466dee..68931632f 100644 --- a/init/signal_handler.cpp +++ b/init/signal_handler.cpp @@ -136,7 +136,14 @@ static bool wait_for_one_process() { struct listnode* node; list_for_each(node, &svc->onrestart.commands) { command* cmd = node_to_item(node, struct command, clist); - cmd->func(cmd->nargs, cmd->args); + std::vector<std::string> arg_strs; + if (expand_command_arguments(cmd->nargs, cmd->args, &arg_strs)) { + std::vector<char*> args; + for (auto& s : arg_strs) { + args.push_back(&s[0]); + } + cmd->func(args.size(), &args[0]); + } } svc->NotifyStateChange("restarting"); return true; |