summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/tuntap.cc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-12-28 12:12:35 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-28 12:12:35 -0800
commit5dc60a76328af5baf2b9f92021fbb7d6b64ef21e (patch)
tree65f9d9912f20a21cfc5ddb7854953ba07cc3caae /test/syscalls/linux/tuntap.cc
parentd07915987631f4c3c6345275019a5b5b0cf28dbb (diff)
parent5259b90dac7201c2e2f80ff5e1c25050e11d4035 (diff)
Merge pull request #5166 from kevinGC:bk-warnings
PiperOrigin-RevId: 349314945
Diffstat (limited to 'test/syscalls/linux/tuntap.cc')
-rw-r--r--test/syscalls/linux/tuntap.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/syscalls/linux/tuntap.cc b/test/syscalls/linux/tuntap.cc
index 97d554e72..5ac337d1a 100644
--- a/test/syscalls/linux/tuntap.cc
+++ b/test/syscalls/linux/tuntap.cc
@@ -324,8 +324,9 @@ TEST_F(TuntapTest, PingKernel) {
};
while (1) {
inpkt r = {};
- int n = read(fd.get(), &r, sizeof(r));
- EXPECT_THAT(n, SyscallSucceeds());
+ int nread = read(fd.get(), &r, sizeof(r));
+ EXPECT_THAT(nread, SyscallSucceeds());
+ long unsigned int n = static_cast<long unsigned int>(nread);
if (n < sizeof(pihdr)) {
std::cerr << "Ignored packet, protocol: " << r.pi.pi_protocol
@@ -383,8 +384,9 @@ TEST_F(TuntapTest, SendUdpTriggersArpResolution) {
};
while (1) {
inpkt r = {};
- int n = read(fd.get(), &r, sizeof(r));
- EXPECT_THAT(n, SyscallSucceeds());
+ int nread = read(fd.get(), &r, sizeof(r));
+ EXPECT_THAT(nread, SyscallSucceeds());
+ long unsigned int n = static_cast<long unsigned int>(nread);
if (n < sizeof(pihdr)) {
std::cerr << "Ignored packet, protocol: " << r.pi.pi_protocol