[FIX] calculation app_type 49/27049/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 3 Sep 2014 14:38:19 +0000 (18:38 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 3 Sep 2014 14:54:28 +0000 (18:54 +0400)
Change-Id: I922c141c7ee213140aa143910be8371e6ef96fab
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
daemon/daemon.c
daemon/target.c

index 38acb2e..d903788 100644 (file)
@@ -502,12 +502,15 @@ static pid_t get_current_pid(void)
 static void target_set_type(struct target *t)
 {
        pid_t ppid = target_get_ppid(t);
+       enum app_type_t app_type = APP_TYPE_UNKNOWN;
 
        if (get_current_pid() == ppid) {
-               t->app_type = APP_TYPE_COMMON;
+               app_type = APP_TYPE_COMMON;
        } else if (get_lpad_pid(ppid) == ppid) {
-               t->app_type = APP_TYPE_TIZEN;
+               app_type = APP_TYPE_TIZEN;
        }
+
+       t->app_type = app_type;
 }
 
 
index 471d4e6..3dbeb66 100644 (file)
@@ -44,6 +44,7 @@ struct target *target_ctor(void)
 
        t = target_malloc();
        if (t) {
+               t->app_type = APP_TYPE_UNKNOWN;
                t->pid = UNKNOWN_PID;
                t->socket = UNKNOWN_FD;
                t->event_fd = UNKNOWN_FD;