Skip to content

Commit ebf5c4f

Browse files
authored
Merge pull request #946 from aschnell/master
- more defensive programming
2 parents 6a74818 + 6e3a73f commit ebf5c4f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

snapper/FileUtils.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) [2011-2014] Novell, Inc.
3-
* Copyright (c) [2018-2023] SUSE LLC
3+
* Copyright (c) [2018-2024] SUSE LLC
44
*
55
* All Rights Reserved.
66
*
@@ -388,6 +388,10 @@ namespace snapper
388388
SDir::statvfs() const
389389
{
390390
struct statvfs fsbuf;
391+
392+
static_assert(sizeof(fsbuf.f_blocks) == 8);
393+
static_assert(sizeof(fsbuf.f_bavail) == 8);
394+
391395
if (fstatvfs(dirfd, &fsbuf) != 0)
392396
SN_THROW(IOErrorException(sformat("statvfs failed path:%s errno:%d (%s)", base_path.c_str(),
393397
errno, stringerror(errno).c_str())));

0 commit comments

Comments
 (0)