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 `&&`.
This commit is contained in:
Barnabás Pőcze 2021-03-04 19:11:55 +01:00 committed by Wim Taymans
parent 49846d7550
commit 3c01cfe8f8

View file

@ -191,7 +191,7 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff
else if (len < 0) { else if (len < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
if (errno != EAGAIN || errno != EWOULDBLOCK) if (errno != EAGAIN && errno != EWOULDBLOCK)
goto recv_error; goto recv_error;
return -EAGAIN; return -EAGAIN;
} }