summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2021-11-11 12:49:01 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2021-11-11 15:43:02 +0900
commita8f63eec9bca4a3a58699294b4c6216d5240c1d0 (patch)
treefa5e2502e3e248863c90284d0dbe58bd1a23e84f
parent5cd1f3dfa1d17422fdae54e9c27bac15e7d83819 (diff)
downloadlaunchpad-a8f63eec9bca4a3a58699294b4c6216d5240c1d0.tar.gz
launchpad-a8f63eec9bca4a3a58699294b4c6216d5240c1d0.tar.bz2
launchpad-a8f63eec9bca4a3a58699294b4c6216d5240c1d0.zip
Fix id file creation
The child process writes zero to the id file. When calling the aul_initialize(), the process will write one to the id file. This is to check the socket status of the running application. Requires: - https://review.tizen.org/gerrit/#/c/platform/core/appfw/launchpad/+/266359/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/aul-1/+/266360/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/amd/+/266361/ Change-Id: I0abe08650b60d4e97f039ffaa16a20c299054110 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--src/lib/common/src/launchpad_common.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/common/src/launchpad_common.c b/src/lib/common/src/launchpad_common.c
index 17ab641..7bfd547 100644
--- a/src/lib/common/src/launchpad_common.c
+++ b/src/lib/common/src/launchpad_common.c
@@ -1415,17 +1415,18 @@ int _verify_proc_caps(void)
int _prepare_id_file(void)
{
char path[PATH_MAX];
- int fd;
+ FILE* fp;
snprintf(path, sizeof(path), "/run/aul/apps/%u/%d/%s",
getuid(), getpid(), getenv("AUL_APPID"));
- fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0600);
- if (fd < 0) {
- _E("Failed to create %s. errno(%d)", path, errno);
+ fp = fopen(path, "w");
+ if (!fp) {
+ _E("fopen() is failed. path(%s), errno(%d)", path, errno);
return -1;
}
- close(fd);
+ fprintf(fp, "0");
+ fclose(fp);
return 0;
}