From: Abhay Agarwal Date: Tue, 14 Jan 2020 11:38:58 +0000 (+0530) Subject: Fix check for db file size X-Git-Tag: accepted/tizen/unified/20200210.131729~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5b1a06fbbe62bd000a118c0814f29c09bf4945b;p=platform%2Fcore%2Fconnectivity%2Fua-manager.git Fix check for db file size Database file should not be 0 after db creation Change-Id: I93803f853ffd6b3afed3b18010cc556da7eb3417 Signed-off-by: Abhay Agarwal --- diff --git a/packaging/ua-manager.spec b/packaging/ua-manager.spec index 21bc4aa..afb09ad 100644 --- a/packaging/ua-manager.spec +++ b/packaging/ua-manager.spec @@ -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 diff --git a/ua-daemon/src/ua-manager-db.c b/ua-daemon/src/ua-manager-db.c index 7404e8e..71e10fb 100644 --- a/ua-daemon/src/ua-manager-db.c +++ b/ua-daemon/src/ua-manager-db.c @@ -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 */