From: Hwankyu Jhun Date: Wed, 21 Dec 2016 07:36:01 +0000 (+0900) Subject: Fix standard I/O redirection X-Git-Tag: accepted/tizen/3.0/tv/20161221.103834 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2F3.0%2Ftv%2F20161221.103834;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix standard I/O redirection - The child process doesn't redirect std fds when the launch request is for debugging. Change-Id: I10958679eda3ab88dd515bc6025074a5cffd0598 Signed-off-by: Hwankyu Jhun --- diff --git a/src/launchpad.c b/src/launchpad.c index 0ccd9f9..f1c8011 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "perf.h" #include "launchpad_common.h" @@ -509,7 +508,7 @@ static int __normal_fork_exec(int argc, char **argv, const char *app_path) } _close_all_fds(); - _setup_stdio(basename(argv[LOADER_ARG_PATH])); + if (execv(argv[LOADER_ARG_PATH], argv) < 0) { /* Flawfinder: ignore */ if (errno == EACCES) { _E("such a file is no executable - %s", @@ -716,6 +715,9 @@ static int __prepare_exec(const char *appid, const char *app_path, return PAD_ERR_REJECTED; } + if (bundle_get_type(kb, AUL_K_SDK) == BUNDLE_TYPE_NONE) + _setup_stdio(basename(app_path)); + /* SET DUMPABLE - for coredump*/ prctl(PR_SET_DUMPABLE, 1);