Check the result of the packet 40/212140/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 15 Aug 2019 12:52:30 +0000 (21:52 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 15 Aug 2019 12:53:26 +0000 (21:53 +0900)
If the request is failed, the cmd of the packet is a negative error value.

Change-Id: If5ef6e9c16719063cc89a5b0d5ab9bc8222d3b42
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_comp_context.c
src/aul_comp_info.c

index ed86ac0..860cb52 100644 (file)
@@ -366,6 +366,13 @@ API int aul_comp_context_usr_create(const char *comp_id, uid_t uid,
                return aul_error_convert(ret);
        }
 
+       if (pkt->cmd != APP_GET_INFO_OK) {
+               _E("Failed to get component info. error(%d)", pkt->cmd);
+               ret = pkt->cmd;
+               free(pkt);
+               return ret;
+       }
+
        b = NULL;
        if (pkt->opt & AUL_SOCK_BUNDLE) {
                b = bundle_decode(pkt->data, pkt->len);
index d956c4e..a9fc3de 100644 (file)
@@ -901,6 +901,13 @@ API int aul_comp_info_usr_create(const char *comp_id, uid_t uid,
                return aul_error_convert(ret);
        }
 
+       if (pkt->cmd != APP_GET_INFO_OK) {
+               _E("Failed to get component info. error(%d)", pkt->cmd);
+               ret = pkt->cmd;
+               free(pkt);
+               return ret;
+       }
+
        b = NULL;
        if (pkt->opt & AUL_SOCK_BUNDLE) {
                b = bundle_decode(pkt->data, pkt->len);