mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-05 00:03:33 +00:00
mem/pidfd: fix poll retry error checking
One should never rely on errno if libc syscall is successful. We can
either see an errno set from some previous failed syscall or even errno
set by a this successful libc syscall. So lets check ret first.
Fixes: 1ccdaf47 ("criu: add pidfd based pid reuse detection for RPC
clients")
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
1c08709cdb
commit
c1b2d194e9
1 changed files with 1 additions and 1 deletions
|
|
@ -246,7 +246,7 @@ static int check_pidfd_entry_state(struct pidfd_entry *entry)
|
|||
|
||||
while (1) {
|
||||
ret = poll(&pollfd, 1, 0);
|
||||
if (errno == EINTR && restart_cnt < MAX_RESTARTS) {
|
||||
if (ret == -1 && errno == EINTR && restart_cnt < MAX_RESTARTS) {
|
||||
restart_cnt++;
|
||||
continue; /* restart polling */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue