diff options
author | B. Stack <bgstack15@gmail.com> | 2023-01-22 13:56:55 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-01-22 13:56:55 -0500 |
commit | 75e05bc441382db69c842a64c562738cb749214e (patch) | |
tree | 698b60b3b4b914bf7958cf1174d0373909bf1e8f /zen/process_exec.cpp | |
parent | add upstream 11.29 (diff) | |
download | FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.gz FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.bz2 FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.zip |
add upstream 12.0
Diffstat (limited to 'zen/process_exec.cpp')
-rw-r--r-- | zen/process_exec.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/process_exec.cpp b/zen/process_exec.cpp index ffc90b4f..89df9f8b 100644 --- a/zen/process_exec.cpp +++ b/zen/process_exec.cpp @@ -154,7 +154,7 @@ std::pair<int /*exit code*/, std::string> processExecuteImpl(const Zstring& file THROW_LAST_SYS_ERROR("fcntl(F_SETFL, O_NONBLOCK)"); - const auto endTime = std::chrono::steady_clock::now() + std::chrono::milliseconds(*timeoutMs); + const auto stopTime = std::chrono::steady_clock::now() + std::chrono::milliseconds(*timeoutMs); for (;;) //EINTR handling? => allow interruption!? { //read until EAGAIN @@ -172,18 +172,18 @@ std::pair<int /*exit code*/, std::string> processExecuteImpl(const Zstring& file //wait for stream input const auto now = std::chrono::steady_clock::now(); - if (now > endTime) + if (now > stopTime) throw SysErrorTimeOut(_P("Operation timed out after 1 second.", "Operation timed out after %x seconds.", *timeoutMs / 1000)); - const auto waitTimeMs = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - now).count(); + const auto waitTimeMs = std::chrono::duration_cast<std::chrono::milliseconds>(stopTime - now).count(); timeval tv{.tv_sec = static_cast<long>(waitTimeMs / 1000)}; tv.tv_usec = static_cast<long>(waitTimeMs - tv.tv_sec * 1000) * 1000; - fd_set rfd = {}; //includes FD_ZERO + fd_set rfd{}; //includes FD_ZERO FD_SET(fdLifeSignR, &rfd); - if (const int rv = ::select(fdLifeSignR + 1, //int nfds + if (const int rv = ::select(fdLifeSignR + 1, //int nfds = "highest-numbered file descriptor in any of the three sets, plus 1" &rfd, //fd_set* readfds nullptr, //fd_set* writefds nullptr, //fd_set* exceptfds |