From 5619fefe0a540ae9c17c660d0826db36ffe75b8c Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 17 Nov 2020 15:28:52 +0300 Subject: [PATCH] mdbx-test: fix `actor_poll()` against the `EBADF` error from pipe. --- test/osal-unix.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/osal-unix.cc b/test/osal-unix.cc index 57643667..7c0bedbc 100644 --- a/test/osal-unix.cc +++ b/test/osal-unix.cc @@ -414,6 +414,7 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) { while (sigalarm_tail == sigalarm_head) { int status; pid = waitpid(0, &status, options); + const int err = errno; if (pid > 0) { if (WIFEXITED(status)) @@ -437,20 +438,19 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) { if (sigusr1_tail != sigusr1_head) { sigusr1_tail = sigusr1_head; logging::progress_canary(true); - if (pid < 0 && errno == EINTR) + if (pid < 0 && err == EINTR) continue; } if (sigusr2_tail != sigusr2_head) { sigusr2_tail = sigusr2_head; logging::progress_canary(false); - if (pid < 0 && errno == EINTR) + if (pid < 0 && err == EINTR) continue; } if (pid == 0) break; - int err = errno; if (err != EINTR) return err; }