Refactoring and add detail comments
authorPetr Bred <p.bred@samsung.com>
Fri, 28 Sep 2018 10:16:34 +0000 (13:16 +0300)
committerPetr Bred <p.bred@samsung.com>
Fri, 28 Sep 2018 10:16:34 +0000 (13:16 +0300)
Signed-off-by: Petr Bred <p.bred@samsung.com>
NativeLauncher/launcher/injection.cc
NativeLauncher/launcher/injection.h
NativeLauncher/launcher/main.cc

index 31134f6..5e18e90 100644 (file)
@@ -51,7 +51,7 @@ ret:
        return res;
 }
 
-int doInjection()
+int checkInjection()
 {
        int res = -1;
        char *env = nullptr;
index 3a08992..6bcf111 100644 (file)
@@ -17,6 +17,6 @@
 #ifndef __INJETION_INTERFACE_H__
 #define __INJETION_INTERFACE_H__
 
-int doInjection();
+int checkInjection();
 
 #endif // __INJETION_INTERFACE_H__
index c11c423..78441e3 100644 (file)
@@ -152,7 +152,11 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
 
 int main(int argc, char *argv[])
 {
-       int res = doInjection();
+    /* checkInjection checks dotnet-launcher run mode,
+       if it contains DOTNET_LAUNCHER_INJECT variable, it injects library.
+       At the moment, this mechanism is used only when the Memory Profiler is started.
+    */
+       int res = checkInjection();
        if (res != 0) {
                return 1;
        }