adb: split daemon services out of service_to_fd.
Let minadbd override daemon services by pulling out the daemon services
into a separate translation unit, that isn't compiled into libadbd.
Bug: http://b/111831478
Test: mma
Change-Id: Iecfebea371e03864108eca9a4d2e9cfd5db34749
diff --git a/daemon/jdwp_service.cpp b/daemon/jdwp_service.cpp
index 175e82e..b40faee 100644
--- a/daemon/jdwp_service.cpp
+++ b/daemon/jdwp_service.cpp
@@ -311,7 +311,7 @@
jdwp_process_list_updated();
}
-int create_jdwp_connection_fd(int pid) {
+unique_fd create_jdwp_connection_fd(int pid) {
D("looking for pid %d in JDWP process list", pid);
for (auto& proc : _jdwp_list) {
@@ -320,7 +320,7 @@
if (adb_socketpair(fds) < 0) {
D("%s: socket pair creation failed: %s", __FUNCTION__, strerror(errno));
- return -1;
+ return unique_fd{};
}
D("socketpair: (%d,%d)", fds[0], fds[1]);
@@ -329,11 +329,11 @@
fdevent_add(proc->fde, FDE_WRITE);
}
- return fds[0];
+ return unique_fd{fds[0]};
}
}
D("search failed !!");
- return -1;
+ return unique_fd{};
}
/** VM DEBUG CONTROL SOCKET