summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2018-05-08 08:11:50 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2018-05-08 08:11:50 +0900
commitc563f92aecf5c9e667c52283ada8b7662d6778e5 (patch)
tree2938f577cc05a32ffa5919e89da1103e8dc2e046
parent86648bebfe94b9654f71dbbbecacddfb7c72a971 (diff)
downloadaul-1-c563f92aecf5c9e667c52283ada8b7662d6778e5.tar.gz
aul-1-c563f92aecf5c9e667c52283ada8b7662d6778e5.tar.bz2
aul-1-c563f92aecf5c9e667c52283ada8b7662d6778e5.zip
Fix static analysis issue
- Adds checking return value Change-Id: I11877e1cbd625a24b26c80f69c20c27808d9f365 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--src/widget.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/widget.c b/src/widget.c
index 2aaea238..7e25a853 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -62,8 +62,14 @@ static int __init_log(void)
int offset;
char buffer[256] = {0, };
char caller[255] = {0, };
+ int ret;
+
+ ret = aul_app_get_appid_bypid(getpid(), caller, sizeof(caller));
+ if (ret != AUL_R_OK) {
+ _E("Failed to get appid by pid(%d)", getpid());
+ return -1;
+ }
- aul_app_get_appid_bypid(getpid(), caller, sizeof(caller));
snprintf(buffer, sizeof(buffer),
"/run/aul/log/widget/%d/widget_%s.log", getuid(), caller);
__log_fd = open(buffer, O_CREAT | O_WRONLY, 0644);