Commit dc61dc63 authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'origin/issue/788', close #788

parents e35e7016 78ce68f1
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "caf/detail/get_mac_addresses.hpp" #include "caf/detail/get_mac_addresses.hpp"
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/detail/socket_guard.hpp" #include "caf/detail/scope_guard.hpp"
#if defined(CAF_MACOS) || defined(CAF_BSD) || defined(CAF_IOS) #if defined(CAF_MACOS) || defined(CAF_BSD) || defined(CAF_IOS)
...@@ -130,7 +130,9 @@ std::vector<iface_info> get_mac_addresses() { ...@@ -130,7 +130,9 @@ std::vector<iface_info> get_mac_addresses() {
perror("socket"); perror("socket");
return {}; return {};
} }
socket_guard guard{sck}; auto g = make_scope_guard([&] {
close(sck);
});
// query available interfaces // query available interfaces
char buf[1024] = {0}; char buf[1024] = {0};
ifconf ifc; ifconf ifc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment