error handling: Use RETRY_ON_EINTR() macro where applicable

There is a defined RETRY_ON_EINTR() macro in qemu/osdep.h
which handles the same while loop.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/415
Signed-off-by: Nikita Ivanov <nivanov@cloudlinux.com>
Message-Id: <20221023090422.242617-3-nivanov@cloudlinux.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[thuth: Dropped the hunk that changed socket_accept() in libqtest.c]
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Nikita Ivanov 2022-10-23 12:04:22 +03:00 committed by Thomas Huth
parent 8b6aa69365
commit 37b0b24e93
13 changed files with 45 additions and 81 deletions

View file

@ -64,9 +64,7 @@ static void sigfd_handler(void *opaque)
ssize_t len;
while (1) {
do {
len = read(fd, &info, sizeof(info));
} while (len == -1 && errno == EINTR);
len = RETRY_ON_EINTR(read(fd, &info, sizeof(info)));
if (len == -1 && errno == EAGAIN) {
break;