From 083fc514d523a7ee09c565e551347fa2e295305c Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 12 Oct 2026 18:16:34 +0300 Subject: [PATCH] fix it temporaary --- src/io/fd_istream.hpp | 2 +- src/io/fd_ostream.hpp | 5 ++++- src/main.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/io/fd_istream.hpp b/src/io/fd_istream.hpp index edc23aa81..74af1e6b7 100644 --- a/src/io/fd_istream.hpp +++ b/src/io/fd_istream.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include diff --git a/src/io/fd_ostream.hpp b/src/io/fd_ostream.hpp index 813eb060f..b5131a54d 100644 --- a/src/io/fd_ostream.hpp +++ b/src/io/fd_ostream.hpp @@ -116,7 +116,10 @@ protected: size_t remaining = size; while (remaining > 0) { const auto written = ::write(fd, ptr, remaining); - if (written <= 0) { + if (written < 0) { + if (errno == EINTR) { + continue; + } return -1; } ptr += written; diff --git a/src/main.cpp b/src/main.cpp index 9d8d8e551..3dc54e686 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ int main(int argc, char** argv) { std::cerr << err.what() << std::endl; return EXIT_FAILURE; } + std::signal(SIGPIPE, SIG_IGN); std::signal(SIGTERM, sigterm_handler); #ifdef NDEBUG std::signal(SIGINT, sigterm_handler);