Fix wrong error handling 19/168119/4
authorSeungha Son <seungha.son@samsung.com>
Wed, 24 Jan 2018 08:03:55 +0000 (17:03 +0900)
committerSeungha Son <seungha.son@samsung.com>
Thu, 25 Jan 2018 08:39:13 +0000 (17:39 +0900)
 Assigning value NOTIFICATION_ERROR_IO_ERROR to ret,
 but that stored value is overwrriten before return

Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: I45700d3b6142bfbb87d2a74bb1463fd1d080d523

src/notification_noti.c

index 18aba87..9d964ae 100755 (executable)
@@ -1469,8 +1469,10 @@ EXPORT_API int notification_noti_get_count(notification_type_e type,
 
        /* Check current sim status */
        ret = vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &status);
-       if (ret < 0)
-               return NOTIFICATION_ERROR_IO_ERROR;
+       if (ret < 0) {
+               status = VCONFKEY_TELEPHONY_SIM_INSERTED;
+               WARN("vconf_get_int");
+       }
 
        db = notification_db_open();
        if (!db)
@@ -1662,8 +1664,10 @@ EXPORT_API int notification_noti_get_grouping_list(notification_type_e type,
 
        /* Check current sim status */
        ret = vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &status);
-       if (ret < 0)
-               ret = NOTIFICATION_ERROR_IO_ERROR;
+       if (ret < 0) {
+               status = VCONFKEY_TELEPHONY_SIM_INSERTED;
+               WARN("vconf_get_int");
+       }
 
        if (status == VCONFKEY_TELEPHONY_SIM_INSERTED) {
                if (type != NOTIFICATION_TYPE_NONE) {
@@ -1741,8 +1745,10 @@ EXPORT_API int notification_noti_get_detail_list(const char *app_id,
 
        /* Check current sim status */
        ret = vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &status);
-       if (ret < 0)
-               return NOTIFICATION_ERROR_IO_ERROR;
+       if (ret < 0) {
+               status = VCONFKEY_TELEPHONY_SIM_INSERTED;
+               WARN("vconf_get_int");
+       }
 
        db = notification_db_open();
        if (!db)