From 3b1cb2af395af304c754014f30cd66ee221b13a9 Mon Sep 17 00:00:00 2001 From: lizhao Date: Wed, 23 Oct 2024 16:48:49 +0800 Subject: [PATCH 1/2] add log of free space --- services/updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/updater.cpp b/services/updater.cpp index b7046301..706164b7 100644 --- a/services/updater.cpp +++ b/services/updater.cpp @@ -196,7 +196,7 @@ int CheckStatvfs(const uint64_t totalPkgSize) return UPDATE_ERROR; } } - + LOG(INFO) << "Number of free blocks = " << updaterVfs.f_bfree << ", Number of free inodes = " << updaterVfs.f_ffree; if (static_cast(updaterVfs.f_bfree) * static_cast(updaterVfs.f_bsize) <= totalPkgSize) { LOG(ERROR) << "Can not update, free space is not enough"; UPDATER_UI_INSTANCE.ShowUpdInfo(TR(UPD_SPACE_NOTENOUGH), true); -- Gitee From a0926d0650987a35babbfbfd2cbb4e89841660c1 Mon Sep 17 00:00:00 2001 From: lizhao Date: Wed, 23 Oct 2024 17:22:09 +0800 Subject: [PATCH 2/2] add errno log Signed-off-by: lizhao --- services/applypatch/store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/applypatch/store.cpp b/services/applypatch/store.cpp index 39e85910..cf6bd8cd 100644 --- a/services/applypatch/store.cpp +++ b/services/applypatch/store.cpp @@ -111,7 +111,7 @@ int32_t Store::WriteDataToStore(const std::string &dirPath, const std::string &f int fd = open(pathTmp.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd == -1) { - LOG(ERROR) << "Failed to create store"; + LOG(ERROR) << "Failed to create store, " << strerror(errno); return -1; } if (size < 0 || !WriteFully(fd, buffer.data(), static_cast(size))) { -- Gitee