summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2018-05-14 15:17:56 -0500
committerJosh Gao2018-05-22 16:55:36 -0500
commite5353021baba3aff13e2dea6601aa8f31c5a42dc (patch)
tree521cb5963d929f61f870e031b6bc9b177d1a94ec
parent71f775a9448d483e031767f0a1afb5ef104a36d0 (diff)
downloadplatform-system-core-e5353021baba3aff13e2dea6601aa8f31c5a42dc.tar.gz
platform-system-core-e5353021baba3aff13e2dea6601aa8f31c5a42dc.tar.xz
platform-system-core-e5353021baba3aff13e2dea6601aa8f31c5a42dc.zip
adb: delete FDEVENT_DONTCLOSE.
The only existing usage of this doesn't actually need it. Bug: http://b/79786774 Test: mma Change-Id: If5e665705393e938cfdbf1526beb5496a8b99a9b
-rw-r--r--adb/daemon/jdwp_service.cpp3
-rw-r--r--adb/fdevent.cpp9
-rw-r--r--adb/fdevent.h3
3 files changed, 2 insertions, 13 deletions
diff --git a/adb/daemon/jdwp_service.cpp b/adb/daemon/jdwp_service.cpp
index 89577cb7c..211d8f345 100644
--- a/adb/daemon/jdwp_service.cpp
+++ b/adb/daemon/jdwp_service.cpp
@@ -139,8 +139,6 @@ struct JdwpProcess {
139 fatal("could not create fdevent for new JDWP process"); 139 fatal("could not create fdevent for new JDWP process");
140 } 140 }
141 141
142 this->fde->state |= FDE_DONT_CLOSE;
143
144 /* start by waiting for the PID */ 142 /* start by waiting for the PID */
145 fdevent_add(this->fde, FDE_READ); 143 fdevent_add(this->fde, FDE_READ);
146 } 144 }
@@ -148,7 +146,6 @@ struct JdwpProcess {
148 ~JdwpProcess() { 146 ~JdwpProcess() {
149 if (this->socket >= 0) { 147 if (this->socket >= 0) {
150 adb_shutdown(this->socket); 148 adb_shutdown(this->socket);
151 adb_close(this->socket);
152 this->socket = -1; 149 this->socket = -1;
153 } 150 }
154 151
diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp
index b3ff457ec..f9e262c51 100644
--- a/adb/fdevent.cpp
+++ b/adb/fdevent.cpp
@@ -111,9 +111,6 @@ static std::string dump_fde(const fdevent* fde) {
111 if (fde->state & FDE_ERROR) { 111 if (fde->state & FDE_ERROR) {
112 state += "E"; 112 state += "E";
113 } 113 }
114 if (fde->state & FDE_DONT_CLOSE) {
115 state += "D";
116 }
117 return android::base::StringPrintf("(fdevent %d %s)", fde->fd, state.c_str()); 114 return android::base::StringPrintf("(fdevent %d %s)", fde->fd, state.c_str());
118} 115}
119 116
@@ -157,10 +154,8 @@ void fdevent_destroy(fdevent* fde) {
157 if (fde->state & FDE_PENDING) { 154 if (fde->state & FDE_PENDING) {
158 g_pending_list.remove(fde); 155 g_pending_list.remove(fde);
159 } 156 }
160 if (!(fde->state & FDE_DONT_CLOSE)) { 157 adb_close(fde->fd);
161 adb_close(fde->fd); 158 fde->fd = -1;
162 fde->fd = -1;
163 }
164 fde->state = 0; 159 fde->state = 0;
165 fde->events = 0; 160 fde->events = 0;
166 } 161 }
diff --git a/adb/fdevent.h b/adb/fdevent.h
index 2d8efd8db..9c6e06999 100644
--- a/adb/fdevent.h
+++ b/adb/fdevent.h
@@ -27,9 +27,6 @@
27#define FDE_WRITE 0x0002 27#define FDE_WRITE 0x0002
28#define FDE_ERROR 0x0004 28#define FDE_ERROR 0x0004
29 29
30/* features that may be set (via the events set/add/del interface) */
31#define FDE_DONT_CLOSE 0x0080
32
33typedef void (*fd_func)(int fd, unsigned events, void *userdata); 30typedef void (*fd_func)(int fd, unsigned events, void *userdata);
34 31
35struct fdevent { 32struct fdevent {