adb: add an id field to fdevent.
Tracking fdevents by pointer is dangerous because an fdevent can be
destroyed and recreated at the same address. Add a monotonically
increasing id field to fdevent for this purpose.
Test: treehugger
Change-Id: I706b57a9e669290ef2db258f85489a5155fc1152
diff --git a/adb/fdevent.h b/adb/fdevent.h
index 39fa9c2..d501b86 100644
--- a/adb/fdevent.h
+++ b/adb/fdevent.h
@@ -32,6 +32,8 @@
typedef void (*fd_func)(int fd, unsigned events, void *userdata);
struct fdevent {
+ uint64_t id;
+
unique_fd fd;
int force_eof = 0;