summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Son <seungha.son@samsung.com>2017-10-16 12:22:08 +0900
committerSeungha Son <seungha.son@samsung.com>2017-10-16 16:20:10 +0900
commit121d0bf2eef642ab7657edb58cc93712354edded (patch)
tree850441cb39e1da11b59a8e9483570ecd8cf23d5c
parent014f624aeb0dd79c86b115cf279a2c0f06d21ee1 (diff)
downloadnotification-121d0bf2eef642ab7657edb58cc93712354edded.tar.gz
notification-121d0bf2eef642ab7657edb58cc93712354edded.tar.bz2
notification-121d0bf2eef642ab7657edb58cc93712354edded.zip
Add set_last_result() to check error
Signed-off-by: Seungha Son <seungha.son@samsung.com> Change-Id: Ib8224aa5a04e6c794c46573d50056a0abef2dd4f
-rwxr-xr-xsrc/notification_internal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/notification_internal.c b/src/notification_internal.c
index 0519daa..3a79332 100755
--- a/src/notification_internal.c
+++ b/src/notification_internal.c
@@ -1014,15 +1014,19 @@ notification_h notification_load_for_uid(char *app_id,
noti = (notification_h)calloc(1, sizeof(struct _notification));
if (noti == NULL) {
NOTIFICATION_ERR("Failed to alloc memory");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
return NULL;
}
ret = notification_ipc_request_load_noti_by_priv_id(noti, app_id, priv_id, uid);
if (ret != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
+ set_last_result(ret);
return NULL;
}
+ set_last_result(NOTIFICATION_ERROR_NONE);
+
return noti;
}
/* LCOV_EXCL_STOP */