From: Vyacheslav Cherkashin Date: Tue, 25 Aug 2015 12:15:34 +0000 (+0300) Subject: [FIX] killing apps for TV X-Git-Tag: submit/tizen/20151105.065919~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F46752%2F3;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] killing apps for TV Change-Id: I3203ff19729d7fce12125648227a5b9516a18787 Signed-off-by: Vyacheslav Cherkashin --- diff --git a/daemon/Makefile b/daemon/Makefile index bc4af9b..4cda24b 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -37,6 +37,13 @@ FLAGS := \ $(INCLUDE) \ $(DEBUG_FLAGS) + +# set profile info +ifeq ($(PROFILE_TV),y) +FLAGS += -DPROFILE_TV +endif # PROFILE_TV + + # CALL_MNGR ifeq ($(CALL_MNGR),y) FLAGS += -DCALL_MNGR diff --git a/daemon/utils.c b/daemon/utils.c index e1689e5..c722d7f 100644 --- a/daemon/utils.c +++ b/daemon/utils.c @@ -362,10 +362,17 @@ static int find_alternative_bin_path(const char *binary_path, char *alter_bin_pa int kill_app(const char *binary_path) { +#ifdef PROFILE_TV + /* usage of SIGTERM signal isn't possible on TV */ + enum { FINISH_SIG = SIGKILL }; +#else /* PROFILE_TV */ + enum { FINISH_SIG = SIGTERM }; +#endif /* PROFILE_TV */ + pid_t pkg_pid; char alter_bin_path[PATH_MAX]; - LOGI("kill %s (%d)\n", binary_path, SIGKILL); + LOGI("kill %s (%d)\n", binary_path, FINISH_SIG); pkg_pid = get_pid_by_path(binary_path); @@ -375,9 +382,9 @@ int kill_app(const char *binary_path) } if (pkg_pid != 0) { - if (kill(pkg_pid, SIGTERM) == -1) { + if (kill(pkg_pid, FINISH_SIG) == -1) { GETSTRERROR(errno, err_buf); - LOGE("cannot kill %d -%d errno<%s>\n", pkg_pid, SIGKILL, + LOGE("cannot kill %d -%d errno<%s>\n", pkg_pid, FINISH_SIG, err_buf); return -1; } else { @@ -385,7 +392,7 @@ int kill_app(const char *binary_path) // returns control immediately after send signal // without it app_launch returns err on start app sleep(1); - LOGI("killed %d -%d\n", pkg_pid, SIGKILL); + LOGI("killed %d -%d\n", pkg_pid, FINISH_SIG); } } else LOGI("cannot kill <%s>; process not found\n", binary_path); diff --git a/packaging/swap-manager.spec b/packaging/swap-manager.spec index 46fb01b..19308ca 100644 --- a/packaging/swap-manager.spec +++ b/packaging/swap-manager.spec @@ -59,7 +59,9 @@ cd daemon SWAP_BUILD_CMD+=" CALL_MNGR=y" %endif -%if "%{?tizen_profile_name}" != "tv" +%if "%{?tizen_profile_name}" == "tv" +SWAP_BUILD_CMD+=" PROFILE_TV=y" +%else SWAP_BUILD_CMD+=" WSP_SUPPORT=y" %endif