Fix check for db file size 17/222517/1
authorAbhay Agarwal <ay.agarwal@samsung.com>
Tue, 14 Jan 2020 11:38:58 +0000 (17:08 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 16 Jan 2020 00:02:48 +0000 (09:02 +0900)
Database file should not be 0 after db creation

Change-Id: I93803f853ffd6b3afed3b18010cc556da7eb3417
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
packaging/ua-manager.spec
ua-daemon/src/ua-manager-db.c

index 21bc4aa..afb09ad 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ua-manager
 Summary:    User awareness manager
-Version:    0.13.16
+Version:    0.13.17
 Release:    1
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 7404e8e..71e10fb 100644 (file)
@@ -425,7 +425,7 @@ static int __uam_db_verify()
        /* check table existance*/
        retv_if(UAM_ERROR_NONE != __uam_db_check_table_creation(), UAM_ERROR_DB_FAILED);
        /* check db size */
-       _uam_get_file_size(DATABASE_FULL_PATH);
+       retv_if(0 >= _uam_get_file_size(DATABASE_FULL_PATH), UAM_ERROR_DB_FAILED);
        /* check db integrity */
        retv_if(UAM_ERROR_NONE != __uam_db_check_integrity(), UAM_ERROR_DB_FAILED);
        /* set locking mode */