• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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':

libsysutils: Fix bug where we'd leak our control pipes when closing down a listener

変更サマリ

差分

--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -83,13 +83,13 @@ int SocketListener::stopListener() {
8383 return -1;
8484 }
8585
86- LOGD("Signaled listener thread - waiting for it to die");
8786 void *ret;
8887 if (pthread_join(mThread, &ret)) {
8988 LOGE("Error joining to listener thread (%s)", strerror(errno));
9089 return -1;
9190 }
92- LOGD("Listener stopped");
91+ close(mCtrlPipe[0]);
92+ close(mCtrlPipe[1]);
9393 return 0;
9494 }
9595
@@ -97,7 +97,6 @@ void *SocketListener::threadStart(void *obj) {
9797 SocketListener *me = reinterpret_cast<SocketListener *>(obj);
9898
9999 me->runListener();
100- LOGD("Listener thread shutting down");
101100 pthread_exit(NULL);
102101 return NULL;
103102 }
@@ -143,10 +142,8 @@ void SocketListener::runListener() {
143142 continue;
144143 }
145144
146- if (FD_ISSET(mCtrlPipe[0], &read_fds)) {
147- LOGD("Control message received");
145+ if (FD_ISSET(mCtrlPipe[0], &read_fds))
148146 break;
149- }
150147 if (mListen && FD_ISSET(mSock, &read_fds)) {
151148 struct sockaddr addr;
152149 socklen_t alen = sizeof(addr);
@@ -157,7 +154,6 @@ void SocketListener::runListener() {
157154 sleep(1);
158155 continue;
159156 }
160- LOGD("SocketListener client connection accepted");
161157 pthread_mutex_lock(&mClientsLock);
162158 mClients->push_back(new SocketClient(c));
163159 pthread_mutex_unlock(&mClientsLock);