diff options
author | Andrei Vagin <avagin@google.com> | 2019-05-28 22:28:01 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-05-30 12:06:15 -0700 |
commit | 4b9cb381572e0f61f2a6c2259094548172900e0d (patch) | |
tree | 8f995b4453216f545a27249bbf28a4f354aecc5d /test/syscalls/linux/socket_unix.cc | |
parent | 507a15dce974d0cff18253ba50af29d6579bacc5 (diff) |
gvisor: socket() returns EPROTONOSUPPORT if protocol is not supported
PiperOrigin-RevId: 250426407
Diffstat (limited to 'test/syscalls/linux/socket_unix.cc')
-rw-r--r-- | test/syscalls/linux/socket_unix.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/syscalls/linux/socket_unix.cc b/test/syscalls/linux/socket_unix.cc index 09a1c1c6e..95cf8d2a3 100644 --- a/test/syscalls/linux/socket_unix.cc +++ b/test/syscalls/linux/socket_unix.cc @@ -1567,15 +1567,14 @@ TEST_P(UnixSocketPairTest, TIOCOUTQSucceeds) { } TEST_P(UnixSocketPairTest, NetdeviceIoctlsSucceed) { - FileDescriptor sock = - ASSERT_NO_ERRNO_AND_VALUE(Socket(AF_UNIX, SOCK_DGRAM, 0)); + auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); // Prepare the request. struct ifreq ifr; snprintf(ifr.ifr_name, IFNAMSIZ, "lo"); // Check that the ioctl either succeeds or fails with ENODEV. - int err = ioctl(sock.get(), SIOCGIFINDEX, &ifr); + int err = ioctl(sockets->first_fd(), SIOCGIFINDEX, &ifr); if (err < 0) { ASSERT_EQ(errno, ENODEV); } |