system/corennnnn
リビジョン | 8cdd90163ec7103e3cec95c0f402cfc068b8de03 (tree) |
---|---|
日時 | 2009-05-13 11:06:54 |
作者 | San Mehat <san@goog...> |
コミッター | The Android Open Source Project |
am dbdb0db: libsysutils: Fix bug where we\'d leak our control pipes when
Merge commit 'dbdb0db516fa4935ff7b5c05914932099237d808'
* commit 'dbdb0db516fa4935ff7b5c05914932099237d808':
@@ -83,13 +83,13 @@ int SocketListener::stopListener() { | ||
83 | 83 | return -1; |
84 | 84 | } |
85 | 85 | |
86 | - LOGD("Signaled listener thread - waiting for it to die"); | |
87 | 86 | void *ret; |
88 | 87 | if (pthread_join(mThread, &ret)) { |
89 | 88 | LOGE("Error joining to listener thread (%s)", strerror(errno)); |
90 | 89 | return -1; |
91 | 90 | } |
92 | - LOGD("Listener stopped"); | |
91 | + close(mCtrlPipe[0]); | |
92 | + close(mCtrlPipe[1]); | |
93 | 93 | return 0; |
94 | 94 | } |
95 | 95 |
@@ -97,7 +97,6 @@ void *SocketListener::threadStart(void *obj) { | ||
97 | 97 | SocketListener *me = reinterpret_cast<SocketListener *>(obj); |
98 | 98 | |
99 | 99 | me->runListener(); |
100 | - LOGD("Listener thread shutting down"); | |
101 | 100 | pthread_exit(NULL); |
102 | 101 | return NULL; |
103 | 102 | } |
@@ -143,10 +142,8 @@ void SocketListener::runListener() { | ||
143 | 142 | continue; |
144 | 143 | } |
145 | 144 | |
146 | - if (FD_ISSET(mCtrlPipe[0], &read_fds)) { | |
147 | - LOGD("Control message received"); | |
145 | + if (FD_ISSET(mCtrlPipe[0], &read_fds)) | |
148 | 146 | break; |
149 | - } | |
150 | 147 | if (mListen && FD_ISSET(mSock, &read_fds)) { |
151 | 148 | struct sockaddr addr; |
152 | 149 | socklen_t alen = sizeof(addr); |
@@ -157,7 +154,6 @@ void SocketListener::runListener() { | ||
157 | 154 | sleep(1); |
158 | 155 | continue; |
159 | 156 | } |
160 | - LOGD("SocketListener client connection accepted"); | |
161 | 157 | pthread_mutex_lock(&mClientsLock); |
162 | 158 | mClients->push_back(new SocketClient(c)); |
163 | 159 | pthread_mutex_unlock(&mClientsLock); |