Fix get_available_memory() 80/62580/1
authormin7.choi <min7.choi@samsung.com>
Thu, 17 Mar 2016 00:37:17 +0000 (09:37 +0900)
committermin7.choi <min7.choi@samsung.com>
Thu, 17 Mar 2016 00:37:17 +0000 (09:37 +0900)
Change-Id: I9ebe876a55ef40dfc1e78973fed68a2c272e257e
Signed-off-by: min7.choi <min7.choi@samsung.com>
agent/download-agent-file.c

index ea901e2..4195766 100755 (executable)
@@ -881,9 +881,9 @@ da_ret_t get_available_memory(char *dir_path, da_size_t len)
        if (!dir_path)
                return DA_ERR_INVALID_INSTALL_PATH;
 
-       //fs_ret = statfs(dir_path, &filesys_info);
+       fs_ret = statfs(dir_path, &filesys_info);
        // Using this as it considers FOTA memory while returning available memory
-       fs_ret = storage_get_internal_memory_size(&filesys_info);
+       //fs_ret = storage_get_internal_memory_size(&filesys_info);
 
        if (fs_ret != 0) {
        //      DA_LOGE("statfs error[%s]", strerror(errno));
@@ -891,7 +891,7 @@ da_ret_t get_available_memory(char *dir_path, da_size_t len)
        //      return DA_ERR_INVALID_INSTALL_PATH;
        }
 
-       double available_size =  (double)filesys_info.f_bsize * filesys_info.f_bavail;
+       double available_size =  (double)filesys_info.f_frsize * filesys_info.f_bavail;
        double total_size = (double)filesys_info.f_frsize * filesys_info.f_blocks;
        DA_SECURE_LOGI(" total = %lf ", total_size);
        DA_SECURE_LOGI(" available = %lf ",available_size);