Fix for svace issue 518382 03/290103/1 accepted/tizen/unified/20230322.080542
authorHyunsub <hyunsube.lee@samsung.com>
Mon, 20 Mar 2023 07:37:26 +0000 (16:37 +0900)
committerHyunsub <hyunsube.lee@samsung.com>
Mon, 20 Mar 2023 07:37:47 +0000 (16:37 +0900)
Change-Id: I22239fec80cae6799529cc3627091beaefcdcaa1

provider/download-provider-db.c
provider/download-provider-utils.c
provider/include/download-provider-db.h
provider/include/download-provider-utils.h

index 61a27d6..5e047ac 100755 (executable)
@@ -240,7 +240,7 @@ static char *__dp_db_get_client_db_path(char *pkgname)
 }
 
 // 0 : remove, -1: error or skip by diff_time
-int dp_db_remove_database(char *pkgname, long now_time, long diff_time)
+int dp_db_remove_database(char *pkgname, long long now_time, long long diff_time)
 {
        // get file name
        char *database = __dp_db_get_client_db_path(pkgname);
@@ -250,9 +250,9 @@ int dp_db_remove_database(char *pkgname, long now_time, long diff_time)
        }
        int result = -1;
        // get modified time of database file.
-       long modified_time = dp_get_file_modified_time(database);
+       long long modified_time = dp_get_file_modified_time(database);
        if (modified_time >= now_time) {
-               TRACE_ERROR("check system timezone %ld vs %ld", modified_time, now_time);
+               TRACE_ERROR("check system timezone %lld vs %lld", modified_time, now_time);
        } else if ((now_time - modified_time) > diff_time) {
                char *database_journal = sqlite3_mprintf("%s-journal", database);
                if (database_journal == NULL) {
index 440aafa..ba8d05d 100644 (file)
@@ -73,7 +73,7 @@ int dp_is_file_exist(const char *file_path)
        return -1;
 }
 
-long dp_get_file_modified_time(const char *file_path)
+long long dp_get_file_modified_time(const char *file_path)
 {
        struct stat file_state;
        int stat_ret;
index 4168e4b..7d1c824 100755 (executable)
@@ -21,7 +21,7 @@ int dp_db_check_connection(void *handle);
 int dp_db_open_client_manager(void **handle, int *errorcode);
 int dp_db_open_client(void **handle, char *pkgname, int *errorcode);
 int dp_db_open_client_v2(void **handle, char *pkgname);
-int dp_db_remove_database(char *pkgname, long now_time, long diff_time);
+int dp_db_remove_database(char *pkgname, long long now_time, long long diff_time);
 int dp_db_get_ids(void *handle, const char *table, char *idcolumn, int *ids, const char *where, const int limit, char *ordercolumn, char *ordering, int *error);
 int dp_db_get_crashed_ids(void *handle, const char *table, int *ids, const int limit, int *error);
 void dp_db_close(void *handle);
index d965db4..0698cd1 100644 (file)
@@ -19,7 +19,7 @@
 
 char *dp_strdup(char *src);
 int dp_is_file_exist(const char *file_path);
-long dp_get_file_modified_time(const char *file_path);
+long long dp_get_file_modified_time(const char *file_path);
 int dp_remove_file(const char *file_path);
 
 #endif