Bug 34798 - VMChannel.accept() does not set kind field properly
Summary: VMChannel.accept() does not set kind field properly
Status: NEW
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.96.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-15 14:11 UTC by freebeans
Modified: 2008-05-20 05:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-05-20 05:41:15


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description freebeans 2008-01-15 14:11:23 UTC
Current implementation:
---
  public VMChannel accept() throws IOException
  {
    int new_fd = accept(nfd.getNativeFD());
    if (new_fd == -1) // non-blocking accept had no pending connection
      return null;
    return new VMChannel(new_fd);
  }
---
It does not set 'kind' field of new VMChannel object. I think it should be:
---
  public VMChannel accept() throws IOException
  {
    int new_fd = accept(nfd.getNativeFD());
    if (new_fd == -1) // non-blocking accept had no pending connection
      return null;
    VMChannel result = new VMChannel(new_fd);
    result.kind = Kind.SOCK_STREAM;
    return result;
  }
Comment 1 Casey Marshall 2008-05-20 05:41:15 UTC
I think this is a bug.

Though, we don't ever check if a native fd is a SOCK_STREAM anywhere, so it just happens to be OK in this case.