Revert "Add a way to turn off unique_fd's operator int."
This reverts commit 93d63c010ae24ff58acb70216bfcb93e3c73019a.
Reason for revert: b/131312539 - All aosp-master-with-phones phones failing boot / health check.
Change-Id: Id4239f93484b7d6b8d9bcd355a59cbd40d9766e2
diff --git a/adb/sysdeps/posix/network.cpp b/adb/sysdeps/posix/network.cpp
index c5c2275..4de240e 100644
--- a/adb/sysdeps/posix/network.cpp
+++ b/adb/sysdeps/posix/network.cpp
@@ -104,13 +104,13 @@
socklen_t addrlen = sizeof(addr_storage);
sockaddr* addr = (ipv6 ? loopback_addr6 : loopback_addr4)(&addr_storage, &addrlen, port);
- if (bind(s.get(), addr, addrlen) != 0) {
+ if (bind(s, addr, addrlen) != 0) {
set_error(error);
return -1;
}
if (type == SOCK_STREAM || type == SOCK_SEQPACKET) {
- if (listen(s.get(), SOMAXCONN) != 0) {
+ if (listen(s, SOMAXCONN) != 0) {
set_error(error);
return -1;
}
diff --git a/adb/sysdeps/uio.h b/adb/sysdeps/uio.h
index ced884b..d06ef89 100644
--- a/adb/sysdeps/uio.h
+++ b/adb/sysdeps/uio.h
@@ -18,8 +18,6 @@
#include <sys/types.h>
-#include "adb_unique_fd.h"
-
#if defined(_WIN32)
// Layout of this struct must match struct WSABUF (verified via static assert in sysdeps_win32.cpp)
@@ -28,15 +26,13 @@
void* iov_base;
};
-ssize_t adb_writev(borrowed_fd fd, const adb_iovec* iov, int iovcnt);
+ssize_t adb_writev(int fd, const adb_iovec* iov, int iovcnt);
#else
#include <sys/uio.h>
using adb_iovec = struct iovec;
-inline ssize_t adb_writev(borrowed_fd fd, const adb_iovec* iov, int iovcnt) {
- return writev(fd.get(), iov, iovcnt);
-}
+#define adb_writev writev
#endif