< prev index next >

src/java.base/unix/native/libjava/childproc.c

Print this page

        

@@ -311,18 +311,10 @@
  */
 int
 childProcess(void *arg)
 {
     const ChildStuff* p = (const ChildStuff*) arg;
-    int fail_pipe_fd = p->fail[1];
-
-    if (p->sendAlivePing) {
-        /* Child shall signal aliveness to parent at the very first
-         * moment. */
-        int code = CHILD_IS_ALIVE;
-        restartableWrite(fail_pipe_fd, &code, sizeof(code));
-    }
 
     /* Close the parent sides of the pipes.
        Closing pipe fds here is redundant, since closeDescriptors()
        would do it anyways, but a little paranoia is a good thing. */
     if ((closeSafely(p->in[1])   == -1) ||

@@ -349,16 +341,13 @@
         if (moveDescriptor(p->err[1] != -1 ? p->err[1] : p->fds[2],
                            STDERR_FILENO) == -1)
             goto WhyCantJohnnyExec;
     }
 
-    if (moveDescriptor(fail_pipe_fd, FAIL_FILENO) == -1)
+    if (moveDescriptor(p->fail[1], FAIL_FILENO) == -1)
         goto WhyCantJohnnyExec;
 
-    /* We moved the fail pipe fd */
-    fail_pipe_fd = FAIL_FILENO;
-
     /* close everything */
     if (closeDescriptors() == 0) { /* failed,  close the old way */
         int max_fd = (int)sysconf(_SC_OPEN_MAX);
         int fd;
         for (fd = FAIL_FILENO + 1; fd < max_fd; fd++)

@@ -386,11 +375,11 @@
      * We use FD_CLOEXEC together with the fact that a read() on a pipe
      * yields EOF when the write ends (we have two of them!) are closed.
      */
     {
         int errnum = errno;
-        restartableWrite(fail_pipe_fd, &errnum, sizeof(errnum));
+        restartableWrite(FAIL_FILENO, &errnum, sizeof(errnum));
     }
-    close(fail_pipe_fd);
+    close(FAIL_FILENO);
     _exit(-1);
     return 0;  /* Suppress warning "no return value from function" */
 }
< prev index next >