[Archive] fix TCT fail issue. (synced latest tizen_2.4 branch code)
authorjk.pu <jk.pu@samsung.com>
Wed, 26 Aug 2015 01:33:33 +0000 (10:33 +0900)
committerjk.pu <jk.pu@samsung.com>
Wed, 26 Aug 2015 01:34:20 +0000 (10:34 +0900)
Change-Id: I4bd2a86da6693461a4a37af7b502596782b68248
Signed-off-by: jk.pu <jk.pu@samsung.com>
src/archive/filesystem_file.cc [changed mode: 0755->0644]
src/archive/filesystem_file.h [changed mode: 0755->0644]
src/archive/filesystem_node.cc [changed mode: 0755->0644]
src/archive/un_zip.cc [changed mode: 0755->0644]
src/archive/un_zip.h [changed mode: 0755->0644]
src/archive/un_zip_extract_request.cc [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 04e963e..cbd8de7
@@ -22,7 +22,7 @@ namespace extension {
 namespace filesystem {
 
 File::File(NodePtr node, const File::PermissionList &parentPermissions,
-        const std::string original_location) :
+        const std::string& original_location) :
     m_node(node),
     m_parentPerms(parentPermissions)
 {
old mode 100755 (executable)
new mode 100644 (file)
index 1dcf06d..9879567
@@ -38,7 +38,7 @@ public:
 
     File(NodePtr node,
             const PermissionList &parentPermissions,
-            const std::string original_location = std::string());
+            const std::string& original_location = std::string());
     virtual ~File();
 
     NodePtr getNode() const;
old mode 100755 (executable)
new mode 100644 (file)
index 7c266d1..4e2744b
@@ -147,7 +147,7 @@ PlatformResult Node::resolve(const PathPtr& path, NodePtr* node)
         }
     }
 
-    if (!S_ISDIR(info.st_mode) & !S_ISREG(info.st_mode) && !S_ISLNK(info.st_mode)) {
+    if ((!S_ISDIR(info.st_mode)) & (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
         LoggerE("throw IOException for file:[%s]", path->getFullPath().c_str());
         return PlatformResult(ErrorCode::IO_ERR, "Platform node is of unsupported type.");
     }
@@ -599,11 +599,10 @@ PlatformResult Node::removeAsDirectory(const PathPtr& path, bool recursive)
             LoggerE("throw IOException");
             return PlatformResult(ErrorCode::IO_ERR, "Node does not exist or access denied.");
         }
-        int err = 0;
         struct dirent entry = {0};
         struct dirent* result = nullptr;
         PlatformResult platform_result(ErrorCode::NO_ERROR);
-        while ((0 == (err = readdir_r(dir, &entry, &result))) && result) {
+        while ((0 == (readdir_r(dir, &entry, &result))) && result) {
             if (!strcmp(entry.d_name, ".") || !strncmp(entry.d_name, "..", 2)) {
                 continue;
             }
old mode 100755 (executable)
new mode 100644 (file)
index 51724c2..8b8b2ce
@@ -438,7 +438,7 @@ PlatformResult generateArchiveStatistics(const std::string& file_name, unz_file_
 
 PlatformResult UnZip::updateCallbackWithArchiveStatistics(ExtractAllProgressCallback* callback,
         unz_global_info& out_global_info,
-        const std::string optional_filter)
+        const std::string& optional_filter)
 {
     LoggerD("Enter");
     int err = unzGetGlobalInfo(m_unzip, &out_global_info);
old mode 100755 (executable)
new mode 100644 (file)
index 30dc9e3..187d9c5
@@ -83,7 +83,7 @@ private:
 
     PlatformResult updateCallbackWithArchiveStatistics(ExtractAllProgressCallback* callback,
             unz_global_info& out_global_info,
-            const std::string optional_filter = std::string());
+            const std::string& optional_filter = std::string());
 
     std::string m_zipfile_name;
     unzFile m_unzip;
old mode 100755 (executable)
new mode 100644 (file)
index aeebcd8..6aef520
@@ -421,7 +421,6 @@ PlatformResult UnZipExtractRequest::handleFileEntry()
     }
     m_delete_output_file = true;
 
-    int read_size = 0;
     bool marked_as_finished = false;
 
     LoggerD("Started extracting: [%s] uncompressed size: %d - %s", m_filename_inzip,
@@ -448,7 +447,7 @@ PlatformResult UnZipExtractRequest::handleFileEntry()
             return PlatformResult(ErrorCode::OPERATION_CANCELED_ERR);
         }
 
-        read_size = unzReadCurrentFile(m_owner.m_unzip, m_buffer, buffer_size);
+        int read_size = unzReadCurrentFile(m_owner.m_unzip, m_buffer, buffer_size);
         if (read_size < 0) {
             LoggerE("unzReadCurrentFile failed with error code:%d for file:%s", read_size,
                     m_filename_inzip);