Skip to content

Commit 3e6d19c

Browse files
committed
Fix a potential binarith->boolean result truncation in raftable.
1 parent 3b08a46 commit 3e6d19c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/raftable/raftable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ static bool poll_until_writable(int sock, int timeout_ms)
8686
struct pollfd pfd = {sock, POLLOUT, 0};
8787
int r = poll(&pfd, 1, timeout_ms);
8888
if (r != 1) return false;
89-
return pfd.revents & POLLOUT;
89+
return (pfd.revents & POLLOUT) != 0;
9090
}
9191

9292
static bool poll_until_readable(int sock, int timeout_ms)
9393
{
9494
struct pollfd pfd = {sock, POLLIN, 0};
9595
int r = poll(&pfd, 1, timeout_ms);
9696
if (r != 1) return false;
97-
return pfd.revents & POLLIN;
97+
return (pfd.revents & POLLIN) != 0;
9898
}
9999

100100
static long msec(TimestampTz timer)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy