diff options
author | Nikita Ivanov <nivanov@cloudlinux.com> | 2022-10-23 12:04:22 +0300 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-01-09 13:50:47 +0100 |
commit | 37b0b24e933c18269dddbf6b83f91823cacf8105 (patch) | |
tree | b36ac8d45a9e188604e44998974d27cf6185e0f3 /qga | |
parent | 8b6aa69365ca6e9bbc3bf557a6ccc5ed2b468bec (diff) |
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>
Diffstat (limited to 'qga')
-rw-r--r-- | qga/commands-posix.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index b19b9c5d18..ebd33a643c 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -63,9 +63,7 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp) *status = 0; - do { - rpid = waitpid(pid, status, 0); - } while (rpid == -1 && errno == EINTR); + rpid = RETRY_ON_EINTR(waitpid(pid, status, 0)); if (rpid == -1) { error_setg_errno(errp, errno, "failed to wait for child (pid: %d)", |