Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Remove comparison between signed and unsigned int
Browse files Browse the repository at this point in the history
Some compilers don't like the comparison between int and size_t. Remove it.

The other changes are minor style cleanups.

PiperOrigin-RevId: 276333450
  • Loading branch information
prattmic authored and gvisor-bot committed Oct 23, 2019
1 parent 6122b41 commit c0065e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/syscalls/linux/sendfile_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ TEST_P(SendFileTest, Shutdown) {
// Create a socket.
std::tuple<int, int> fds = ASSERT_NO_ERRNO_AND_VALUE(Sockets());
const FileDescriptor client(std::get<0>(fds));
FileDescriptor server(std::get<1>(fds)); // non-const, released below.
FileDescriptor server(std::get<1>(fds)); // non-const, reset below.

// If this is a TCP socket, then turn off linger.
if (GetParam() == AF_INET) {
Expand All @@ -210,14 +210,14 @@ TEST_P(SendFileTest, Shutdown) {
// checking the contents (other tests do that), so we just re-use the same
// buffer as above.
ScopedThread t([&]() {
int done = 0;
size_t done = 0;
while (done < data.size()) {
int n = read(server.get(), data.data(), data.size());
int n = RetryEINTR(read)(server.get(), data.data(), data.size());
ASSERT_THAT(n, SyscallSucceeds());
done += n;
}
// Close the server side socket.
ASSERT_THAT(close(server.release()), SyscallSucceeds());
server.reset();
});

// Continuously stream from the file to the socket. Note we do not assert
Expand Down

0 comments on commit c0065e2

Please sign in to comment.