aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-12-06 10:54:03 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-12-06 11:08:01 +0300
commitd3ba148e0415a04e628ac7a6f767b795602e9aa5 (patch)
tree1068a335c2e8b91bfaef8ae8a34e6d5a0b1573af /library/cpp
parentf8ed268194b7a2afcd45bfd8740b2dc36a3abeee (diff)
downloadydb-d3ba148e0415a04e628ac7a6f767b795602e9aa5.tar.gz
Intermediate changes
commit_hash:87c6f9898873ec96e4aa9dc4c7df86e67a11e313
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/yt/stockpile/stockpile_linux.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/yt/stockpile/stockpile_linux.cpp b/library/cpp/yt/stockpile/stockpile_linux.cpp
index 0fc60b94a8..8ae847dec7 100644
--- a/library/cpp/yt/stockpile/stockpile_linux.cpp
+++ b/library/cpp/yt/stockpile/stockpile_linux.cpp
@@ -116,14 +116,14 @@ private:
i64 adjustedBufferSize,
TDuration adjustedPeriod)
{
- int returnCode = -::madvise(nullptr, adjustedBufferSize, MADV_STOCKPILE);
- YT_LOG_DEBUG_IF(returnCode != 0, "System call \"madvise\" failed: %v", strerror(returnCode));
-
- switch(returnCode) {
- case 0:
- Sleep(Options_.Period);
- return {Options_.BufferSize, Options_.Period};
+ int result = ::madvise(nullptr, adjustedBufferSize, MADV_STOCKPILE);
+ if (result == 0) {
+ Sleep(Options_.Period);
+ return {Options_.BufferSize, Options_.Period};
+ }
+ YT_LOG_DEBUG("System call \"madvise\" failed: %v", strerror(errno));
+ switch (errno) {
case ENOMEM:
if (adjustedBufferSize / 2 >= PageSize_) {
// Immediately make an attempt to reclaim half as much.