From: Hayato Kiwata <dev@haytok.jp>
To: passt-dev@passt.top
Cc: Hayato Kiwata <dev@haytok.jp>
Subject: [PATCH] tap: Fix EAGAIN/EWOULDBLOCK check in tap_pasta_input()
Date: Fri, 17 Jul 2026 02:21:21 +0900 [thread overview]
Message-ID: <20260716172121.80216-1-dev@haytok.jp> (raw)
On Linux, EAGAIN and EWOULDBLOCK have the same value. Commit
d2a1dc744b10 ("tap: Restructure in tap_pasta_input()") added a check for
EWOULDBLOCK on purpose:
> - Check for EWOULDBLOCK as well as EAGAIN for the benefit of any future
> ports where those might not have the same value
However, the condition uses && instead of ||, so it can never be true on a
platform where EAGAIN and EWOULDBLOCK are different.
Use || instead so that the check works as intended on such platforms.
Fixes: d2a1dc744b10 ("tap: Restructure in tap_pasta_input()")
Signed-off-by: Hayato Kiwata <dev@haytok.jp>
---
tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tap.c b/tap.c
index d418961..cf87591 100644
--- a/tap.c
+++ b/tap.c
@@ -1329,7 +1329,7 @@ static void tap_pasta_input(struct ctx *c, const struct timespec *now)
continue;
}
- if (errno == EAGAIN && errno == EWOULDBLOCK)
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
break; /* all done for now */
die("Error on tap device, exiting");
--
2.39.5 (Apple Git-154)
next reply other threads:[~2026-07-16 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 17:21 Hayato Kiwata [this message]
2026-07-17 1:30 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260716172121.80216-1-dev@haytok.jp \
--to=dev@haytok.jp \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).