From: Sangyoon Jang Date: Thu, 29 Aug 2019 08:26:53 +0000 (+0900) Subject: Add some error log of handling backup file of preload rw pkg list X-Git-Tag: accepted/tizen/5.5/unified/20191031.024043~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=376d88e6b5ad579e59638c4daf09c13681b6a94a;p=platform%2Fcore%2Fappfw%2Fpkgmgr-tool.git Add some error log of handling backup file of preload rw pkg list Change-Id: I6c0ef27dc5a90bf007966d0e51a9ecd8884c923d Signed-off-by: Sangyoon Jang --- diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index 7612793..1dcddcd 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -164,7 +164,10 @@ static void __make_preload_rw_list(GHashTable *preload_rw_table) char tmp_path[BUF_SIZE]; snprintf(tmp_path, BUF_SIZE, "%s.tmp", ALL_PRELOAD_RW_PKG_LIST); - rename(ALL_PRELOAD_RW_PKG_LIST, tmp_path); + if (rename(ALL_PRELOAD_RW_PKG_LIST, tmp_path)) { + if (errno != ENOENT) + _LOG("can not backup preload rw pkg list: %d", errno); + } file = fopen(ALL_PRELOAD_RW_PKG_LIST, "w"); if (file == NULL) { @@ -175,7 +178,8 @@ static void __make_preload_rw_list(GHashTable *preload_rw_table) g_hash_table_foreach(preload_rw_table, __iter_cb, file); fsync(fileno(file)); fclose(file); - remove(tmp_path); + if (remove(tmp_path)) + _LOG("cannot remove backup file(%s): %d", tmp_path, errno); } static int __is_dir(const char *dirname)