Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4171293

java.lang.Process.get*Stream() doesn't work on UNIX.

XMLWordPrintable

    • sparc
    • solaris_2.5.1

      There seems to be a problem with Process.get*Stream() where * is Input, Output, or Error. I noticed my C program wasn't able to get input from stdin from the java program that called it. I lookd at UNIXProcess.java and in the constructor found something that didn't look quite right:

          UNIXProcess(String cmdarray[], String env[]) throws java.io.IOException {

      stdin_fd = new FileDescriptor();
      stdout_fd = new FileDescriptor();
      stderr_fd = new FileDescriptor();

      Shouldn't this be:

          UNIXProcess(String cmdarray[], String env[]) throws java.io.IOException {

      stdin_fd = FileDescriptor.in; // new FileDescriptor();
      stdout_fd = FileDescriptor.out; // new FileDescriptor();
      stderr_fd = FileDescriptor.err; // new FileDescriptor();

      ?

      I tried this and my problem was solved.

      I hope to be proven wrong since this seems to be a very fundamental bug.

            Unassigned Unassigned
            ejburns Ed Burns (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: