From 6e3a73f974938fb316b0760353cf22fd14e2625a Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Mon, 21 Oct 2024 08:31:55 +0200 Subject: [PATCH] - more defensive programming --- snapper/FileUtils.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snapper/FileUtils.cc b/snapper/FileUtils.cc index 4c8578a1..ca3f9de3 100644 --- a/snapper/FileUtils.cc +++ b/snapper/FileUtils.cc @@ -1,6 +1,6 @@ /* * Copyright (c) [2011-2014] Novell, Inc. - * Copyright (c) [2018-2023] SUSE LLC + * Copyright (c) [2018-2024] SUSE LLC * * All Rights Reserved. * @@ -388,6 +388,10 @@ namespace snapper SDir::statvfs() const { struct statvfs fsbuf; + + static_assert(sizeof(fsbuf.f_blocks) == 8); + static_assert(sizeof(fsbuf.f_bavail) == 8); + if (fstatvfs(dirfd, &fsbuf) != 0) SN_THROW(IOErrorException(sformat("statvfs failed path:%s errno:%d (%s)", base_path.c_str(), errno, stringerror(errno).c_str()))); -- 2.47.3