From 3c01cfe8f8ecf1c10db4e0456bacc5a8f19977a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 4 Mar 2021 19:11:55 +0100 Subject: [PATCH] protocol-native: connection: fix errno check condition The branch should be taken if errno is neither EAGAIN, nor EWOULDBLOCK. Previously, if (errno != EAGAIN || errno != EWOULDBLOCK) would be taken for all values of errno if EAGAIN != EWOULDBLOCK. (Except for the ones that are filtered out before.) Fix that by changing `||` to `&&`. --- src/modules/module-protocol-native/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c index 212e9c948..253468549 100644 --- a/src/modules/module-protocol-native/connection.c +++ b/src/modules/module-protocol-native/connection.c @@ -191,7 +191,7 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff else if (len < 0) { if (errno == EINTR) continue; - if (errno != EAGAIN || errno != EWOULDBLOCK) + if (errno != EAGAIN && errno != EWOULDBLOCK) goto recv_error; return -EAGAIN; }