add common code into launchpad_lib file 94/51894/2 accepted/tizen/mobile/20151117.094225 accepted/tizen/tv/20151117.094250 accepted/tizen/wearable/20151117.094253 submit/tizen/20151117.063236
authorJunghoon, Park <jh9216.park@samsung.com>
Tue, 17 Nov 2015 05:28:57 +0000 (14:28 +0900)
committerJunghoon, Park <jh9216.park@samsung.com>
Tue, 17 Nov 2015 05:50:32 +0000 (14:50 +0900)
Change-Id: I08f9c42dc8dfd09d098b93376210ed1f4821ec22
Signed-off-by: Junghoon, Park <jh9216.park@samsung.com>
inc/launchpad_common.h
src/launchpad.c
src/launchpad_common.c
src/launchpad_lib.c
src/launchpad_loader.c

index 0934a0c..ddd2fab 100644 (file)
@@ -73,7 +73,6 @@ int _create_server_sock(int pid);
 app_pkt_t *_recv_pkt_raw(int fd, int *clifd, struct ucred *cr);
 int _send_pkt_raw(int client_fd, app_pkt_t *pkt);
 int  _connect_to_launchpad(int type);
-void _set_oom(void);
 void _set_env(app_info_from_db * menu_info, bundle * kb);
 char** _create_argc_argv(bundle * kb, int *margc);
 
index 0d5e742..423126b 100755 (executable)
@@ -449,9 +449,6 @@ static int __prepare_exec(const char *appId, const char *app_path,
        /* TODO : should be add to check permission in the kernel*/
        setsid();
 
-       /* SET OOM*/
-       _set_oom();
-
        /* SET PRIVILEGES*/
        if (bundle_get_val(kb, AUL_K_PRIVACY_APPID) == NULL) {
                _D("appId: %s / pkg_type : %s / app_path : %s ", appId, menu_info->pkg_type,
index 6b86b45..afa2dee 100644 (file)
@@ -499,21 +499,6 @@ error:
        return -1;
 }
 
-void _set_oom(void)
-{
-       char buf[MAX_LOCAL_BUFSZ];
-       FILE *fp;
-
-       /* we should reset oomadj value as default because child
-       inherits from parent oom_adj*/
-       snprintf(buf, MAX_LOCAL_BUFSZ, "/proc/%d/oom_adj", getpid());
-       fp = fopen(buf, "w");
-       if (fp == NULL)
-               return;
-       fprintf(fp, "%d", -16);
-       fclose(fp);
-}
-
 void _set_env(app_info_from_db * menu_info, bundle * kb)
 {
        const char *str;
index c22cd3a..376c3c0 100644 (file)
@@ -302,6 +302,12 @@ static int __before_loop(int argc, char **argv)
        }
 #endif
        __preexec_init(argc, argv);
+
+       /* Set new session ID & new process group ID*/
+       /* In linux, child can set new session ID without check permission */
+       /* TODO : should be add to check permission in the kernel*/
+       setsid();
+
        if (__loader_callbacks->create) {
                __loader_callbacks->create(argc, argv, __loader_type, __loader_user_data);
                __loader_adapter->add_fd(__loader_user_data, client_fd, __receiver_cb);
index 8f081c7..13e3a3f 100644 (file)
@@ -80,14 +80,6 @@ static void __loader_create_cb(int argc, char **argv, int type, void *user_data)
        __preload_init(argc, argv);
        __preload_init_for_process_pool();
 
-       /* Set new session ID & new process group ID*/
-       /* In linux, child can set new session ID without check permission */
-       /* TODO : should be add to check permission in the kernel*/
-       setsid();
-
-       /* SET OOM*/
-       _set_oom();
-
        elm_init_cnt = elm_init(g_argc, g_argv);
        _D("[candidate] elm init, returned: %d", elm_init_cnt);