mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx-test: fix actor_poll()
against the EBADF
error from pipe.
This commit is contained in:
parent
94fae97f88
commit
5619fefe0a
@ -414,6 +414,7 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) {
|
|||||||
while (sigalarm_tail == sigalarm_head) {
|
while (sigalarm_tail == sigalarm_head) {
|
||||||
int status;
|
int status;
|
||||||
pid = waitpid(0, &status, options);
|
pid = waitpid(0, &status, options);
|
||||||
|
const int err = errno;
|
||||||
|
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
if (WIFEXITED(status))
|
if (WIFEXITED(status))
|
||||||
@ -437,20 +438,19 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) {
|
|||||||
if (sigusr1_tail != sigusr1_head) {
|
if (sigusr1_tail != sigusr1_head) {
|
||||||
sigusr1_tail = sigusr1_head;
|
sigusr1_tail = sigusr1_head;
|
||||||
logging::progress_canary(true);
|
logging::progress_canary(true);
|
||||||
if (pid < 0 && errno == EINTR)
|
if (pid < 0 && err == EINTR)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sigusr2_tail != sigusr2_head) {
|
if (sigusr2_tail != sigusr2_head) {
|
||||||
sigusr2_tail = sigusr2_head;
|
sigusr2_tail = sigusr2_head;
|
||||||
logging::progress_canary(false);
|
logging::progress_canary(false);
|
||||||
if (pid < 0 && errno == EINTR)
|
if (pid < 0 && err == EINTR)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pid == 0)
|
if (pid == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int err = errno;
|
|
||||||
if (err != EINTR)
|
if (err != EINTR)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user