Skip to content

Commit 34e3bc0

Browse files
[llvm-exegesis] Replace size_t with ssize_t where relevant
Currently BenchmarkRunner.cpp stores the return code of recvmsg as size_t. Not only is this incorrect (as recvmsg returns ssize_t), but it also makes the error code check after the statement completely irrelvant as it checks if the number of bytes read is greater than zero (which will always be true for an unsigned type).
1 parent 39a41c8 commit 34e3bc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class SubProcessFunctionExecutorImpl
221221
Message.msg_control = ControlBuffer;
222222
Message.msg_controllen = sizeof(ControlBuffer);
223223

224-
size_t BytesRead = recvmsg(SocketFD, &Message, 0);
224+
ssize_t BytesRead = recvmsg(SocketFD, &Message, 0);
225225

226226
if (BytesRead < 0)
227227
return make_error<Failure>("Failed to read FD from socket");

0 commit comments

Comments
 (0)