Add the pid to the environment 29/112729/4
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 2 Feb 2017 10:25:28 +0000 (19:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 2 Feb 2017 22:55:57 +0000 (07:55 +0900)
When the application is launched by the debugger,
the application is a child process of the debugger.
The process group of the appliation is not equal to
the process id of the debugger.
If the process id is not equal to the process pid of
the environment variable, the aul socket API will create
the socket link to recevie the request.

Requires:
 - https://review.tizen.org/gerrit/112668

Change-Id: I2f63a9cf74f13157b6cd39c8ad5d37489a37165a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad_common.c

index 5e998c5..201c3d9 100644 (file)
@@ -630,6 +630,7 @@ error:
 void _set_env(appinfo_t *menu_info, bundle *kb)
 {
        const char *str;
+       char buf[MAX_LOCAL_BUFSZ];
 
        str = bundle_get_val(kb, AUL_K_STARTTIME);
        if (str != NULL)
@@ -657,6 +658,9 @@ void _set_env(appinfo_t *menu_info, bundle *kb)
        str = bundle_get_val(kb, AUL_K_API_VERSION);
        if (str != NULL)
                setenv("TIZEN_API_VERSION", str, 1);
+
+       snprintf(buf, sizeof(buf), "%d", getpid());
+       setenv("AUL_PID", buf, 1);
 }
 
 char **_create_argc_argv(bundle *kb, int *margc)