From: jiyong.min Date: Thu, 10 Jan 2019 04:24:30 +0000 (+0900) Subject: Fix the log position to avoid errno change. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0;p=platform%2Fcore%2Fapi%2Fmetadata-editor.git Fix the log position to avoid errno change. Change-Id: Ia7d81de1f5fa4aa766e3d700497d2cadc314456e --- diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index 7d4004e..7d8379a 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -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; } } diff --git a/test/metadata_editor_test.c b/test/metadata_editor_test.c index 1f84eb3..9e08768 100755 --- a/test/metadata_editor_test.c +++ b/test/metadata_editor_test.c @@ -413,7 +413,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; } @@ -421,7 +421,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; }