Remove compilation warning
[platform/framework/native/appfw.git] / src / io / FIo_FileUtil.cpp
index 974a1d0..385aa2f 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -332,10 +331,11 @@ _FileUtil::GetAttributes(const String& filePath, FileAttributes& attribute)
                           GetErrorMessage(GetLastResult()));
 
        struct stat64 statbuf;
-       if (int ret = stat64(pFilePath.get(), &statbuf) == -1)
+       if (stat64(pFilePath.get(), &statbuf) == -1)
        {
                r = __ConvertNativeErrorToResult(errno);
-               SysLogException(NID_IO, r, "[%s] Failed to get file (%s) status.", GetErrorMessage(r), pFilePath.get());
+               SysSecureLogException(NID_IO, r, "[%s] Failed to get file (%s) status. errno: %d (%s)",
+                               GetErrorMessage(r), pFilePath.get(), errno, strerror(errno));
                return r;
        }
 
@@ -373,7 +373,8 @@ _FileUtil::GetFileName(const String& filePath)
        int pos = -1;
 
        result r = filePath.LastIndexOf(L'/', filePath.GetLength() - 1, pos);
-       SysTryReturn(NID_IO, !IsFailed(r), fileName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid.");
+       SysTryReturn(NID_IO, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, fileName, E_INVALID_ARG,
+                       "[E_INVALID_ARG] The file path is invalid.");
 
        r = filePath.SubString(pos + 1, fileName);
        SysTryReturn(NID_IO, !IsFailed(r), fileName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid.");
@@ -391,7 +392,8 @@ _FileUtil::GetFileExtension(const String& filePath)
        int pos = -1;
 
        result r = filePath.LastIndexOf(L'/', filePath.GetLength() - 1, pos);
-       SysTryReturn(NID_IO, !IsFailed(r), extName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid.");
+       SysTryReturn(NID_IO, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, extName, E_INVALID_ARG,
+                       "[E_INVALID_ARG] The file path is invalid.");
 
        String fileName;
        r = filePath.SubString(pos + 1, fileName);