From bfda3be5ae30c0b847ae705028b1fb4d2b1c735f Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Sun, 13 Feb 2022 21:08:20 +0000 Subject: sockets: appease -Wint-in-bool-context warning. * socket.c (open_socket, socketpair_wrap): Replace logical OR of SOCK_NONBLOCK and SOCK_CLOEXEC with bitwise OR in order to silence Clang 13's -Wint-in-bool-context warning. --- socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/socket.c b/socket.c index fe9f22b4..b161aa75 100644 --- a/socket.c +++ b/socket.c @@ -1107,7 +1107,7 @@ static val open_socket(val family, val type, val mode_str) uw_ethrowf(socket_error_s, lit("~a failed: ~d/~s"), self, num(errno), errno_to_str(errno), nao); - if (SOCK_NONBLOCK || SOCK_CLOEXEC) + if (SOCK_NONBLOCK | SOCK_CLOEXEC) type = num_fast(c_num(type, self) & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)); return open_sockfd(num(fd), family, type, mode_str, self); @@ -1126,7 +1126,7 @@ static val socketpair_wrap(val family, val type, val mode_str) uw_ethrowf(socket_error_s, lit("~a failed: ~d/~s"), self, num(errno), errno_to_str(errno), nao); - if (SOCK_NONBLOCK || SOCK_CLOEXEC) + if (SOCK_NONBLOCK | SOCK_CLOEXEC) type = num_fast(c_num(type, self) & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)); { -- cgit v1.2.3