diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/check_native.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/check_native.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/check_native.c b/sysdeps/unix/sysv/linux/check_native.c index b3cbbe369d..6eed8d74e0 100644 --- a/sysdeps/unix/sysv/linux/check_native.c +++ b/sysdeps/unix/sysv/linux/check_native.c @@ -1,5 +1,5 @@ /* Determine whether interfaces use native transport. Linux version. - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,7 +41,7 @@ void __check_native (uint32_t a1_index, int *a1_native, uint32_t a2_index, int *a2_native) { - int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + int fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); struct sockaddr_nl nladdr; memset (&nladdr, '\0', sizeof (nladdr)); @@ -111,10 +111,13 @@ __check_native (uint32_t a1_index, int *a1_native, { struct msghdr msg = { - (void *) &nladdr, sizeof (nladdr), - &iov, 1, - NULL, 0, - 0 + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof (nladdr), + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = NULL, + .msg_controllen = 0, + .msg_flags = 0 }; ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0)); @@ -164,7 +167,7 @@ __check_native (uint32_t a1_index, int *a1_native, while (! done); out: - close_not_cancel_no_status (fd); + __close_nocancel_nostatus (fd); return; |