Fix the log position to avoid errno change. 51/197151/1 accepted/tizen/unified/20190111.055158 submit/tizen/20190109.233706
authorjiyong.min <jiyong.min@samsung.com>
Thu, 10 Jan 2019 04:24:30 +0000 (13:24 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 10 Jan 2019 04:25:07 +0000 (13:25 +0900)
Change-Id: Ia7d81de1f5fa4aa766e3d700497d2cadc314456e

src/metadata_editor.cpp
test/metadata_editor_test.c

index 7d4004e..7d8379a 100755 (executable)
@@ -826,10 +826,11 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char *
        /* check the file exits actually */
        exist = open(path, O_RDONLY);
        if(exist < 0) {
-               metadata_editor_error("Not exist file");
                if (errno == EACCES || errno == EPERM) {
+                       metadata_editor_error("Permission denied");
                        return METADATA_EDITOR_ERROR_PERMISSION_DENIED;
                } else {
+                       metadata_editor_error("Not exist file");
                        return METADATA_EDITOR_ERROR_FILE_EXISTS;
                }
        }
index 6e2bbc6..efc780d 100755 (executable)
@@ -417,7 +417,7 @@ int main(int argc, char *argv[])
        /*__printRetValue("metadata_editor_create(...)",ret); */
 
        if (ret != METADATA_EDITOR_ERROR_NONE) {
-               printf("Fail metadata_editor_create() at line [%d]\n", __LINE__);
+               printf("Fail metadata_editor_create() [%d]\n", ret);
                return 0;
        }
 
@@ -425,7 +425,7 @@ int main(int argc, char *argv[])
        /*__printRetValue("metadata_editor_set_path(...)",ret); */
 
        if (ret != METADATA_EDITOR_ERROR_NONE) {
-               printf("Fail metadata_editor_set_path() at line [%d]\n", __LINE__);
+               printf("Fail metadata_editor_set_path() [%d]\n", ret);
                goto exception;
        }