From: Nadav Har'El <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master
app: clear up the osv::run() confusion
Before this patch we had two unrelated variants of osv::run() - one defined
in core/run.cc which runs a program in the current thread, and one defined
in app.cc which runs it in the background.
I have many reservations on how the second function works - especially
because of commit e270cf9c which prevented cleanup of completed
applications. But what bothers me even more is that these two unrelated
functions are confusingly have exactly the same name, with only slightly
different parameter types to give any hint which one is called.
So this patch changes the name of the second function to
osv::run_background().
Signed-off-by: Nadav Har'El <[email protected]>
Message-Id: <[email protected]>
---
diff --git a/core/app.cc b/core/app.cc
--- a/core/app.cc
+++ b/core/app.cc
@@ -133,7 +133,7 @@ shared_app_t application::run(const std::string&
command,
return app;
}
-void run(const std::vector<std::string>& args) {
+void run_background(const std::vector<std::string>& args) {
application::run(args);
}
diff --git a/include/osv/app.hh b/include/osv/app.hh
--- a/include/osv/app.hh
+++ b/include/osv/app.hh
@@ -238,7 +238,7 @@ namespace osv {
* Creates a new app
* args Arguments passed to the program's main() function.
*/
-void run(const std::vector<std::string>& args);
+void run_background(const std::vector<std::string>& args);
namespace this_application {
diff --git a/modules/httpserver/api/app.cc b/modules/httpserver/api/app.cc
--- a/modules/httpserver/api/app.cc
+++ b/modules/httpserver/api/app.cc
@@ -36,7 +36,7 @@ static void exec_app(const std::string& cmnd_line) {
}
for (auto cmnd: new_commands) {
std::vector<std::string> c(cmnd.begin(), std::prev(cmnd.end()));
- osv::run(c);
+ osv::run_background(c);
}
}
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.