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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Not an Issue
    • Affects Version/s: 1.1.6
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: