From 468f6c15d2a8d6d1c60c941d7ef77efc30d9cdc1 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 30 Jan 2013 08:45:03 -0800 Subject: [PATCH] ZygoteConnection.java: Remove dead code --peer-wait The last caller of this option was removed in system/core commit b94fd1abcbff1eacb8a2ad79c51de21ecf8f6d65 Change-Id: I9f3540c9e61b4a93038b43983fbb8badac08a2e3 --- .../android/internal/os/ZygoteConnection.java | 53 +------------------ 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java index d24513a3035b1..fd7e3b0eefe13 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -75,18 +75,6 @@ class ZygoteConnection { private final Credentials peer; private final String peerSecurityContext; - /** - * A long-lived reference to the original command socket used to launch - * this peer. If "peer wait" mode is specified, the process that requested - * the new VM instance intends to track the lifetime of the spawned instance - * via the command socket. In this case, the command socket is closed - * in the Zygote and placed here in the spawned instance so that it will - * not be collected and finalized. This field remains null at all times - * in the original Zygote process, and in all spawned processes where - * "peer-wait" mode was not requested. - */ - private static LocalSocket sPeerWaitSocket = null; - /** * Constructs instance from connected socket. * @@ -298,11 +286,6 @@ class ZygoteConnection { *
  • --rlimit=r,c,mtuple of values for setrlimit() call. * r is the resource, c and m * are the settings for current and max value. - *
  • --peer-wait indicates that the command socket should - * be inherited by (and set to close-on-exec in) the spawned process - * and used to track the lifetime of that process. The spawning process - * then exits. Without this flag, it is retained by the spawning process - * (and closed in the child) in expectation of a new spawn request. *
  • --classpath=colon-separated classpath indicates * that the specified class (which must b first non-flag argument) should * be loaded from jar files in the specified classpath. Incompatible with @@ -330,9 +313,6 @@ class ZygoteConnection { /** from --setgroups */ int[] gids; - /** from --peer-wait */ - boolean peerWait; - /** * From --enable-debugger, --enable-checkjni, --enable-assert, * --enable-safemode, and --enable-jni-logging. @@ -437,8 +417,6 @@ class ZygoteConnection { debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING; } else if (arg.equals("--enable-assert")) { debugFlags |= Zygote.DEBUG_ENABLE_ASSERT; - } else if (arg.equals("--peer-wait")) { - peerWait = true; } else if (arg.equals("--runtime-init")) { runtimeInit = true; } else if (arg.startsWith("--seinfo=")) { @@ -897,23 +875,8 @@ class ZygoteConnection { FileDescriptor[] descriptors, FileDescriptor pipeFd, PrintStream newStderr) throws ZygoteInit.MethodAndArgsCaller { - /* - * Close the socket, unless we're in "peer wait" mode, in which - * case it's used to track the liveness of this process. - */ - - if (parsedArgs.peerWait) { - try { - ZygoteInit.setCloseOnExec(mSocket.getFileDescriptor(), true); - sPeerWaitSocket = mSocket; - } catch (IOException ex) { - Log.e(TAG, "Zygote Child: error setting peer wait " - + "socket to be close-on-exec", ex); - } - } else { - closeSocket(); - ZygoteInit.closeServerSocket(); - } + closeSocket(); + ZygoteInit.closeServerSocket(); if (descriptors != null) { try { @@ -1044,18 +1007,6 @@ class ZygoteConnection { return true; } - /* - * If the peer wants to use the socket to wait on the - * newly spawned process, then we're all done. - */ - if (parsedArgs.peerWait) { - try { - mSocket.close(); - } catch (IOException ex) { - Log.e(TAG, "Zygote: error closing sockets", ex); - } - return true; - } return false; }