diff options
| author | Neil Fuller <nfuller@google.com> | 2015-07-09 11:38:36 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-09 11:38:36 +0000 |
| commit | f74d27af876ce45bc8fee8254f836d58beae992f (patch) | |
| tree | 50f907d4d31691b82afe808d24594b8294e227b8 /core/java | |
| parent | 2dd56526a6a8447c694bb5540e01cc350664926b (diff) | |
| parent | b27c379b259d42a1e90eb4b4d79abc2426def731 (diff) | |
am b27c379b: am 2ca4f73e: Merge "Switch LocalSocketImpl.accept() over to using Os.accept()"
* commit 'b27c379b259d42a1e90eb4b4d79abc2426def731':
Switch LocalSocketImpl.accept() over to using Os.accept()
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/LocalSocketImpl.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/core/java/android/net/LocalSocketImpl.java b/core/java/android/net/LocalSocketImpl.java index df72da8574c1..72395d28a0ec 100644 --- a/core/java/android/net/LocalSocketImpl.java +++ b/core/java/android/net/LocalSocketImpl.java @@ -206,16 +206,6 @@ class LocalSocketImpl FileDescriptor fd) throws IOException; /** - * Accepts a connection on a server socket. - * - * @param fd file descriptor of server socket - * @param s socket implementation that will become the new socket - * @return file descriptor of new socket - */ - private native FileDescriptor accept - (FileDescriptor fd, LocalSocketImpl s) throws IOException; - - /** * Create a new instance. */ /*package*/ LocalSocketImpl() @@ -338,14 +328,17 @@ class LocalSocketImpl * @param s a socket that will be used to represent the new connection. * @throws IOException */ - protected void accept(LocalSocketImpl s) throws IOException - { + protected void accept(LocalSocketImpl s) throws IOException { if (fd == null) { throw new IOException("socket not created"); } - s.fd = accept(fd, s); - s.mFdCreatedInternally = true; + try { + s.fd = Os.accept(fd, null /* address */); + s.mFdCreatedInternally = true; + } catch (ErrnoException e) { + throw e.rethrowAsIOException(); + } } /** |
