]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- more defensive programming 946/head
authorArvin Schnell <aschnell@suse.de>
Mon, 21 Oct 2024 06:31:55 +0000 (08:31 +0200)
committerArvin Schnell <aschnell@suse.de>
Mon, 21 Oct 2024 06:31:55 +0000 (08:31 +0200)
snapper/FileUtils.cc

index 4c8578a1206fa4060411677b377bde2b45d44232..ca3f9de3351be8cfe94d6cb8ea6b52a1f637d905 100644 (file)
@@ -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())));