summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2022-02-13 21:08:20 +0000
committerKaz Kylheku <kaz@kylheku.com>2022-02-13 13:45:17 -0800
commit9bf2278076ae65f63cf0aacb213c4608f9732bbb (patch)
tree1e927832adb82129e4642dd5da26ba9185848903
parent9ec46dec14376ac3bb042272d6d52c36477cdb6e (diff)
downloadtxr-9bf2278076ae65f63cf0aacb213c4608f9732bbb.tar.gz
txr-9bf2278076ae65f63cf0aacb213c4608f9732bbb.tar.bz2
txr-9bf2278076ae65f63cf0aacb213c4608f9732bbb.zip
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.
-rw-r--r--socket.c4
1 files 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));
{