diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-02-03 20:45:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-02-03 20:45:59 +0000 |
commit | 564aeca94e18cd708f93619551e05b3d59d4abe2 (patch) | |
tree | 69e5717d8a8a4ad3ece04191bce25fed43492c58 /init/builtins.cpp | |
parent | 01b25ab14912712024d5342064c7b70de85e2db8 (diff) | |
parent | 2d0fdaaafc5d2925b8ef7708a950f6b599892b54 (diff) |
Merge "init: clean up exec command"
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 965a81fbe..2388edcf7 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -265,10 +265,14 @@ static int do_exec(const std::vector<std::string>& args) { if (!svc) { return -1; } + if (!start_waiting_for_exec()) { + return -1; + } if (!svc->Start()) { + stop_waiting_for_exec(); + ServiceManager::GetInstance().RemoveService(*svc); return -1; } - waiting_for_exec = true; return 0; } @@ -1018,7 +1022,7 @@ static int do_wait_for_prop(const std::vector<std::string>& args) { << "\") failed: value too long"; return -1; } - if (!wait_property(name, value)) { + if (!start_waiting_for_property(name, value)) { LOG(ERROR) << "do_wait_for_prop(\"" << name << "\", \"" << value << "\") failed: init already in waiting"; return -1; |