This patch prepare to pass argc and argv to the
elf loader so it can forward it to the init()
function of the elf object

Signed-off-by: Benoît Cnet <[email protected]>
---
 core/app.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/app.cc b/core/app.cc
index 515096e..2cf3e42 100644
--- a/core/app.cc
+++ b/core/app.cc
@@ -173,6 +173,7 @@ application::application(const std::string& command,
         }
 
         merge_in_environ(new_program, env);
+        prepare_argc_argv();
         _lib = current_program->get_library(_command);
     } catch(const std::exception &e) {
         throw launch_error(e.what());
@@ -348,8 +349,6 @@ void application::run_main()
 {
     trace_app_main(this, _command.c_str());
 
-    prepare_argc_argv();
-
     // make sure to have a fresh optind across calls
     // FIXME: fails if run() is executed in parallel
     int old_optind = optind;
-- 
2.7.4

-- 
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.

Reply via email to