adb: actually fix the windows build.
am: 58eda35ace
Change-Id: If917d578acb8a0b289369f7b5b1aca7deff4a4b9
diff --git a/libcutils/uevent.c b/libcutils/uevent.c
index 97a81e3..cae232c 100644
--- a/libcutils/uevent.c
+++ b/libcutils/uevent.c
@@ -17,6 +17,7 @@
#include <cutils/uevent.h>
#include <errno.h>
+#include <fcntl.h>
#include <stdbool.h>
#include <string.h>
#include <strings.h>
@@ -104,7 +105,7 @@
addr.nl_pid = getpid();
addr.nl_groups = 0xffffffff;
- s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
+ s = socket(PF_NETLINK, SOCK_DGRAM | O_CLOEXEC, NETLINK_KOBJECT_UEVENT);
if(s < 0)
return -1;
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index eb33d06..5701443 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <fcntl.h>
#include <sys/socket.h>
#include <sys/select.h>
@@ -311,7 +312,7 @@
req.n.nlmsg_len = NLMSG_ALIGN(req.n.nlmsg_len) + RTA_LENGTH(addrlen);
memcpy(RTA_DATA(rta), addr, addrlen);
- s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ s = socket(PF_NETLINK, SOCK_RAW | O_CLOEXEC, NETLINK_ROUTE);
if (send(s, &req, req.n.nlmsg_len, 0) < 0) {
close(s);
return -errno;