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 /net/tap.c | |
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 'net/tap.c')
-rw-r--r-- | net/tap.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -102,9 +102,7 @@ static ssize_t tap_write_packet(TAPState *s, const struct iovec *iov, int iovcnt { ssize_t len; - do { - len = writev(s->fd, iov, iovcnt); - } while (len == -1 && errno == EINTR); + len = RETRY_ON_EINTR(writev(s->fd, iov, iovcnt)); if (len == -1 && errno == EAGAIN) { tap_write_poll(s, true); @@ -577,9 +575,7 @@ static int net_bridge_run_helper(const char *helper, const char *bridge, close(sv[1]); - do { - fd = recv_fd(sv[0]); - } while (fd == -1 && errno == EINTR); + fd = RETRY_ON_EINTR(recv_fd(sv[0])); saved_errno = errno; close(sv[0]); |