am bd9acc22: am e966e577: am 02f042dd: Fix socket descriptor leak from Zygote to child app

* commit 'bd9acc2218fcf3cd6605554a45db2251753ddd7b':
  Fix socket descriptor leak from Zygote to child app
This commit is contained in:
Dave Platt
2014-01-07 19:55:43 +00:00
committed by Android Git Automerger

View File

@@ -192,10 +192,16 @@ public class ZygoteInit {
static void closeServerSocket() {
try {
if (sServerSocket != null) {
FileDescriptor fd = sServerSocket.getFileDescriptor();
sServerSocket.close();
if (fd != null) {
Libcore.os.close(fd);
}
}
} catch (IOException ex) {
Log.e(TAG, "Zygote: error closing sockets", ex);
} catch (libcore.io.ErrnoException ex) {
Log.e(TAG, "Zygote: error closing descriptor", ex);
}
sServerSocket = null;