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 31134f66cced8d1ce511d007154768648b5dcab9..5e18e90df307dd9698fd1990c0297c91a97c65f2 100644 (file)
@@ -51,7 +51,7 @@ ret:
        return res;
 }
 
-int doInjection()
+int checkInjection()
 {
        int res = -1;
        char *env = nullptr;
index 3a08992de05852ae52d8bd20cd2d7017cb4918d1..6bcf11118e1b376e4e697f9ff10ded1133b22752 100644 (file)
@@ -17,6 +17,6 @@
 #ifndef __INJETION_INTERFACE_H__
 #define __INJETION_INTERFACE_H__
 
-int doInjection();
+int checkInjection();
 
 #endif // __INJETION_INTERFACE_H__
index c11c42307c962010a042c968a37e918cf1eb9dae..78441e30b43979c4449ea0457e6d9c788653d88d 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;
        }