mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 19:00:31 +01:00
platform: use nm_steal_fd() in nmp_utils_sysctl_open_netdir()
This commit is contained in:
parent
691e5d5cc9
commit
9096b5572d
1 changed files with 2 additions and 5 deletions
|
|
@ -1277,7 +1277,6 @@ nmp_utils_sysctl_open_netdir (int ifindex,
|
|||
for (try_count = 0; try_count < 10; try_count++, ifname = NULL) {
|
||||
nm_auto_close int fd_dir = -1;
|
||||
nm_auto_close int fd_ifindex = -1;
|
||||
int fd;
|
||||
|
||||
if (!ifname) {
|
||||
ifname = nmp_utils_if_indextoname (ifindex, ifname_buf);
|
||||
|
|
@ -1310,15 +1309,13 @@ nmp_utils_sysctl_open_netdir (int ifindex,
|
|||
continue;
|
||||
fd_buf[nn] = '\0';
|
||||
|
||||
if (ifindex != _nm_utils_ascii_str_to_int64 (fd_buf, 10, 1, G_MAXINT, -1))
|
||||
if (ifindex != (int) _nm_utils_ascii_str_to_int64 (fd_buf, 10, 1, G_MAXINT, -1))
|
||||
continue;
|
||||
|
||||
if (out_ifname)
|
||||
strcpy (out_ifname, ifname);
|
||||
|
||||
fd = fd_dir;
|
||||
fd_dir = -1;
|
||||
return fd;
|
||||
return nm_steal_fd (&fd_dir);
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue