src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c
changeset 50275 69204b98dc3d
parent 47216 71c04702a3d5
child 59329 289000934908
--- a/src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c	Fri May 25 11:59:01 2018 -0700
+++ b/src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c	Fri May 25 12:44:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@
         retry = JNI_FALSE;
         n = recvfrom(fd, buf, len, 0, &sa.sa, &sa_len);
         if (n < 0) {
-            if (errno == EWOULDBLOCK) {
+            if (errno == EAGAIN || errno == EWOULDBLOCK) {
                 return IOS_UNAVAILABLE;
             }
             if (errno == EINTR) {
@@ -217,7 +217,7 @@
 
     n = sendto(fd, buf, len, 0, &sa.sa, sa_len);
     if (n < 0) {
-        if (errno == EAGAIN) {
+        if (errno == EAGAIN || errno == EWOULDBLOCK) {
             return IOS_UNAVAILABLE;
         }
         if (errno == EINTR) {