diff options
author | Dean Deng <deandeng@google.com> | 2021-04-16 14:26:49 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-16 14:33:34 -0700 |
commit | 81ff6bd9213ebb6752fae97fcbc6037323fa6811 (patch) | |
tree | 39e56e98567a55c5464d215ace4b2ec9ddf5da4b /test/syscalls/linux/tuntap.cc | |
parent | 025cff180cb412ec49a85b99c60b8ce2e267704b (diff) |
Use size_t instead of C integer types.
PiperOrigin-RevId: 368919557
Diffstat (limited to 'test/syscalls/linux/tuntap.cc')
-rw-r--r-- | test/syscalls/linux/tuntap.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/syscalls/linux/tuntap.cc b/test/syscalls/linux/tuntap.cc index 93ee11870..6e3a00d2c 100644 --- a/test/syscalls/linux/tuntap.cc +++ b/test/syscalls/linux/tuntap.cc @@ -349,9 +349,8 @@ TEST_F(TuntapTest, PingKernel) { }; while (1) { inpkt r = {}; - int nread = read(fd.get(), &r, sizeof(r)); - EXPECT_THAT(nread, SyscallSucceeds()); - long unsigned int n = static_cast<long unsigned int>(nread); + size_t n; + EXPECT_THAT(n = read(fd.get(), &r, sizeof(r)), SyscallSucceeds()); if (n < sizeof(pihdr)) { std::cerr << "Ignored packet, protocol: " << r.pi.pi_protocol @@ -408,9 +407,8 @@ TEST_F(TuntapTest, SendUdpTriggersArpResolution) { }; while (1) { inpkt r = {}; - int nread = read(fd.get(), &r, sizeof(r)); - EXPECT_THAT(nread, SyscallSucceeds()); - long unsigned int n = static_cast<long unsigned int>(nread); + size_t n; + EXPECT_THAT(n = read(fd.get(), &r, sizeof(r)), SyscallSucceeds()); if (n < sizeof(pihdr)) { std::cerr << "Ignored packet, protocol: " << r.pi.pi_protocol |