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>
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;
}