diff options
author | Christopher Wiley <wiley@google.com> | 2016-08-02 11:26:10 -0700 |
---|---|---|
committer | Christopher Wiley <wiley@google.com> | 2016-08-02 15:54:30 -0700 |
commit | 833ec7eabb5f2ea0dc2281e8910eae6cbb748500 (patch) | |
tree | fc427d199a017478020878f61cdb8887f99352d6 /libwifi_system | |
parent | 5dd6bf1621fc5a4a7d806eb2ce19ea5d46396e32 (diff) | |
download | android_frameworks_opt_net_wifi-833ec7eabb5f2ea0dc2281e8910eae6cbb748500.tar.gz android_frameworks_opt_net_wifi-833ec7eabb5f2ea0dc2281e8910eae6cbb748500.tar.bz2 android_frameworks_opt_net_wifi-833ec7eabb5f2ea0dc2281e8910eae6cbb748500.zip |
Set SOCK_CLOEXEC on libwifi-system interface socket
This is more hygienic, although not especially necessary.
Change-Id: I68d4e19c2daa0a2231b6ae2d0cffd2833a4f7913
Diffstat (limited to 'libwifi_system')
-rw-r--r-- | libwifi_system/interface_tool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libwifi_system/interface_tool.cpp b/libwifi_system/interface_tool.cpp index 264ab7066..af9cc0805 100644 --- a/libwifi_system/interface_tool.cpp +++ b/libwifi_system/interface_tool.cpp @@ -34,7 +34,7 @@ const char kWlan0InterfaceName[] = "wlan0"; } // namespace bool InterfaceTool::SetUpState(const char* if_name, bool request_up) { - base::unique_fd sock(socket(PF_INET, SOCK_DGRAM, 0)); + base::unique_fd sock(socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)); if (sock.get() < 0) { LOG(ERROR) << "Failed to open socket to set up/down state (" << strerror(errno) << ")"; |