Modify return value when device info not found 36/151736/1 submit/tizen/20170922.060433
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 21 Sep 2017 23:57:15 +0000 (08:57 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 21 Sep 2017 23:57:15 +0000 (08:57 +0900)
Change-Id: I83733498ba00884ffa59134f903fcd586514d5f6
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-common-external-storage.c

index b638ab0..ea50dca 100755 (executable)
@@ -163,6 +163,7 @@ int ms_read_device_info(const char *root_path, char **device_uuid)
        GDir *dir = NULL;
        GError *error = NULL;
        const char *name;
+       bool find_item = false;
 
        if (device_uuid == NULL) {
                MS_DBG_ERR("device_uuid is NULL");
@@ -190,6 +191,8 @@ int ms_read_device_info(const char *root_path, char **device_uuid)
                                if (*device_uuid == NULL)
                                        ret = MS_MEDIA_ERR_INTERNAL;
 
+                               find_item = true;
+
                                break;
                        }
                }
@@ -204,6 +207,12 @@ int ms_read_device_info(const char *root_path, char **device_uuid)
                dir = NULL;
        }
 
+       if (!find_item) {
+               *device_uuid = NULL;
+               ret = MS_MEDIA_ERR_FILE_NOT_EXIST;
+               MS_DBG_ERR("[%s]DEV INFO NOT EXIST", root_path);
+       }
+
        return ret;
 }