Remove checking socket creation 39/82839/1 accepted/tizen/common/20160809.184024 accepted/tizen/ivi/20160809.232626 accepted/tizen/mobile/20160809.232405 accepted/tizen/tv/20160809.232516 accepted/tizen/wearable/20160809.232722 submit/tizen/20160809.011327 submit/tizen/20160809.051427
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 8 Aug 2016 05:46:09 +0000 (14:46 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 8 Aug 2016 05:46:09 +0000 (14:46 +0900)
Change-Id: I9c84584498a4feae91249f13152f2a06314ebe5d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/common.h
src/common.c
src/debug-launchpad.c

index 73dada5..d72241c 100644 (file)
@@ -68,8 +68,6 @@ void _appinfo_free(appinfo_t *appinfo);
 void _modify_bundle(bundle *kb, int caller_pid, appinfo_t *appinfo, int cmd);
 void _set_env(appinfo_t *app_info, bundle *kb);
 char **_create_argc_argv(bundle *kb, int *margc, const char *app_path);
-int _proc_check_cmdline_bypid(int pid);
-void _prepare_listen_sock(void);
 int _delete_sock_path(int pid, uid_t uid);
 int _close_all_fds(void);
 
index 343e62d..8912352 100644 (file)
@@ -780,58 +780,6 @@ char **_create_argc_argv(bundle *kb, int *margc, const char *app_path)
        return argv;
 }
 
-static int __read_proc(const char *path, char *buf, int size)
-{
-       int fd;
-       int ret;
-
-       if (buf == NULL || path == NULL)
-               return -1;
-
-       fd = open(path, O_RDONLY);
-       if (fd < 0)
-               return -1;
-
-       ret = read(fd, buf, size - 1);
-       if (ret <= 0) {
-               close(fd);
-               return -1;
-       }
-
-       buf[ret] = 0;
-       close(fd);
-
-       return ret;
-}
-
-int _proc_check_cmdline_bypid(int pid)
-{
-       char buf[MAX_CMD_BUFSZ];
-       int ret;
-
-       snprintf(buf, sizeof(buf), "/proc/%d/cmdline", pid);
-       ret = __read_proc(buf, buf, sizeof(buf));
-       if (ret <= 0)
-               return -1;
-
-       _D("cmdline: %s", buf);
-
-       return 0;
-}
-
-void _prepare_listen_sock(void)
-{
-       int fd;
-       char buf[12];
-
-       fd = __create_server_socket(true);
-       if (fd < 0)
-               return;
-
-       snprintf(buf, sizeof(buf), "%d", fd);
-       setenv("AUL_LISTEN_SOCK", buf, 1);
-}
-
 static int __delete_dir(const char *path)
 {
        DIR *dp;
index f1a872c..c67df3c 100644 (file)
@@ -62,11 +62,7 @@ static int __real_send(int clifd, int ret)
 
 static void __send_result_to_caller(int clifd, int ret)
 {
-       int res;
-       int count = 0;
-       char path[PATH_MAX];
-
-       _W("Check app launching");
+       _W("send result: %d", ret);
 
        if (clifd == -1)
                return;
@@ -77,28 +73,6 @@ static void __send_result_to_caller(int clifd, int ret)
                return;
        }
 
-       snprintf(path, sizeof(path), "/run/aul/apps/%d/%d/.app-sock",
-                       getuid(), ret);
-       _D("socket path: %s", path);
-       do {
-               if (access(path, F_OK) == 0) {
-                       _D("%s exists", path);
-                       break;
-               }
-
-               _D("-- now wait socket creation --");
-               usleep(50 * 1000);
-               count++;
-       } while (count < 20);
-
-       res = _proc_check_cmdline_bypid(ret);
-       if (res < 0) {
-               _E("The app process might be terminated "
-                               "while we are wating %d", ret);
-               __real_send(clifd, -1); /* abnormally launched */
-               return;
-       }
-
        if (__real_send(clifd, ret) < 0) {
                if (kill(ret, SIGKILL) == -1)
                        _E("Failed to send SIGKILL: %d", errno);
@@ -147,8 +121,6 @@ static int __prepare_exec(const char *appid, const char *app_path,
                return -1;
        }
 
-       _prepare_listen_sock();
-
        memset(process_name, '\0', AUL_PR_NAME);
        snprintf(process_name, AUL_PR_NAME, "%s", file_name);
        prctl(PR_SET_NAME, process_name);