diff --git a/libs/main/system/piprocess.cpp b/libs/main/system/piprocess.cpp index 115b9a69..005b56cc 100644 --- a/libs/main/system/piprocess.cpp +++ b/libs/main/system/piprocess.cpp @@ -242,7 +242,16 @@ PRIVATE_DEFINITION_START(PIProcess) BOOL ok = WriteFile(pipes[StdIn][PipeWrite], data.data(), data.size(), &sz, NULL); if (!ok) sz = 0; # else - sz = ::write(pipes[StdIn][PipeWrite], data.data(), data.size()); + size_t offset = 0; + while (offset < data.size()) { + ssize_t wr = ::write(pipes[StdIn][PipeWrite], data.data() + offset, data.size() - offset); + if (wr < 0) { + if (errno == EINTR) continue; + return false; + } + offset += wr; + } + sz = offset; # endif return sz == (SizeType)data.size_s(); }