adb: extract the adb-specific unique_fd out into its own header.
Some POSIX-only files would like to use functions declared in
adb_utils.h without being forced to use the sysdeps stuff for open,
close, etc. Extract the adb-specific unique_fd into its own header so
those files can use adb_utils.h alongside the real unique_fd.
Change-Id: I10344ef26b7e72fce46bf7e3033f89aa54bd6118
Test: mm
diff --git a/adb/adb_utils.cpp b/adb/adb_utils.cpp
index e138a90..db39ef4 100644
--- a/adb/adb_utils.cpp
+++ b/adb/adb_utils.cpp
@@ -17,6 +17,7 @@
#define TRACE_TAG ADB
#include "adb_utils.h"
+#include "adb_unique_fd.h"
#include <libgen.h>
#include <stdlib.h>
@@ -309,3 +310,7 @@
}
return android_dir;
}
+
+void AdbCloser::Close(int fd) {
+ adb_close(fd);
+}