Fix wrong implementation 34/259234/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Jun 2021 23:54:38 +0000 (08:54 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Jun 2021 23:54:38 +0000 (08:54 +0900)
If the return value of aul_sock_recv_reply_pkt() is a negative error value,
the function should return the error value after calling aul_error_convert()
with the return value.
Previous implemenation uses the fd variable. It's a wrong implementation.
This patch uses the ret variable when calling aul_error_convert().

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

index d779820..54e3f73 100644 (file)
@@ -770,7 +770,7 @@ API int aul_get_default_app(bundle *b, char **appid)
        ret = aul_sock_recv_reply_pkt(fd, &pkt);
        if (ret < 0 || pkt == NULL) {
                _E("Failed to get reply. error(%d)", ret);
-               return aul_error_convert(fd);
+               return aul_error_convert(ret);
        }
 
        if (pkt->cmd != APP_GET_INFO_OK) {