LOGI("EXTRA MSG %d|%d|%s\n", log.type, log.length, log.data);
continue;
}
+// else if(log.type == MSG_LOG)// && log.data[0] == '1' && log.data[1] == '3')
+// {
+// LOGI("%dclass|%s\n", log.data[0] - '0', log.data);
+// }
#ifdef PRINT_TARGET_LOG
else if(log.type == MSG_LOG)
{
int exec_app(const char* exec_path, int app_type)
{
pid_t pid;
- char command[PATH_MAX];
char appid[PATH_MAX];
if (exec_path == NULL || strlen(exec_path) <= 0)
int is_same_app_process(char* appPath, int pid)
{
int ret = 0;
+ int tlen;
FILE *fp;
char buf[BUFFER_MAX];
char cmdPath[PATH_MAX];
- char execPath[PATH_MAX];
+ char tPath[PATH_MAX];
+
+ strcpy(tPath, appPath);
+ tlen = strlen(tPath);
+ if(strcmp(tPath + tlen - 4, ".exe") == 0)
+ {
+ // remove .exe from tPath
+ tPath[tlen - 4] = '\0';
+ }
- get_executable(appPath, execPath, PATH_MAX);
sprintf(cmdPath, "/proc/%d/cmdline", pid);
if((fp = fopen(cmdPath, "r")) == NULL)
if(fgets(buf, BUFFER_MAX, fp) != NULL)
{
-#ifdef RUN_APP_LOADER
- if(strcmp(buf, appPath) == 0)
-#else
- // use execPath instead of manager.appPath
- if(strcmp(buf, execPath) == 0)
-#endif
+ tlen = strlen(buf);
+ if(strcmp(buf + tlen - 4, ".exe") == 0)
+ {
+ // remove .exe from tPath
+ buf[tlen - 4] = '\0';
+ }
+
+ if(strcmp(buf, tPath) == 0)
ret = 1;
else
ret = 0;