- `Server.cpp`: Make `checkForUsersNotInMainConfig` static (removes need for style-violating forward declaration)
- `LibSSHLogger.cpp`: Include header in `#else` branch to provide prototype for `initialize`
- `Lexer.cpp`: Include `clickhouse_lexer.h` in standalone build to provide prototypes for `extern "C"` functions
- `compressor.cpp`/`decompressor.cpp`: Make all file-local functions static
- `phdr_cache.cpp`: Add NOLINT for intentional reserved identifier `__lsan_ignore_object`
- BuzzHouse: Add `static` to `CONV_FN`/`CONV_FN_QUOTE` macros and individual functions
- Test/example files: Add `static` to helper functions across ~50 files
- Fix `double-promotion` in `compressor.cpp`, `gtest_compressionCodec.cpp`, `FuzzConfig.cpp`
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Fix clang-tidy `cppcoreguidelines-init-variables` and
`cppcoreguidelines-pro-type-member-init` warnings in compressor.cpp
and decompressor.cpp.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This patch switches from the non-portable statfs API to the
POSIX-standard statvfs API. We also fix the free space calculation,
which was previously only correct by coincidence. The previous
calculation used `f_blocks * st_blksize` to calculate available space.
However, `f_blocks` counts the number of blocks on the filesystem, not
the number of available blocks. And `st_blksize` is an advisory field,
not the actual block size. Using `st_blksize` will yield correct results
when it happens to be set to the same value as the true block size, but
this isn't always the case.
This patch uses f_bavail (blocks available) rather than f_blocks (total
blocks on fs), and f_frsize (block size) rather than st_blksize
(preferred block size).
Fixes#93896.
This reverts commit 6524031348, reversing
changes made to 9bf114f9a3.
This was not a good idea, since the underlying problem was that
`/proc/self/exe` was pointing to `qemu-$ARCH-static` (because the code
uses realpath() over normal interface readlink(), which is not caught by
the qemu linux-user).
And this means that later, it will try to overwrite incorrect binary and
then execute some garbage.
Signed-off-by: Azat Khuzhin <[email protected]>