Add set_last_result() to check error 06/155706/2
authorSeungha Son <seungha.son@samsung.com>
Mon, 16 Oct 2017 03:22:08 +0000 (12:22 +0900)
committerSeungha Son <seungha.son@samsung.com>
Mon, 16 Oct 2017 07:20:10 +0000 (16:20 +0900)
Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: Ib8224aa5a04e6c794c46573d50056a0abef2dd4f

src/notification_internal.c

index 0519daa75ff3544ce51f3992f6478988beff207c..3a79332a1b6dcf63efd63da45efdfa4e03a29241 100755 (executable)
@@ -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 */