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 <n...@scylladb.com>
---
 include/osv/app.hh            | 2 +-
 core/app.cc                   | 2 +-
 modules/httpserver/api/app.cc | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/osv/app.hh b/include/osv/app.hh
index 6fa503a..3237ebc 100644
--- 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/core/app.cc b/core/app.cc
index ad3145f..cc1324f 100644
--- 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/modules/httpserver/api/app.cc b/modules/httpserver/api/app.cc
index 7a711af..6464d40 100644
--- 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);
     }
 }
 
-- 
2.9.3

-- 
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 osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to