equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
786 |
786 |
787 switch (errno) { |
787 switch (errno) { |
788 case ENETUNREACH: /* Network Unreachable */ |
788 case ENETUNREACH: /* Network Unreachable */ |
789 case EAFNOSUPPORT: /* Address Family not supported */ |
789 case EAFNOSUPPORT: /* Address Family not supported */ |
790 case EADDRNOTAVAIL: /* address is not available on the remote machine */ |
790 case EADDRNOTAVAIL: /* address is not available on the remote machine */ |
791 #ifdef __linux__ |
791 #if defined(__linux__) || defined(_AIX) |
792 case EINVAL: |
792 case EINVAL: |
793 case EHOSTUNREACH: |
793 case EHOSTUNREACH: /* No route to host */ |
794 /* |
794 /* |
795 * On some Linux versions, when a socket is bound to the loopback |
795 * On some Linux versions, when a socket is bound to the loopback |
796 * interface, connect will fail and errno will be set to EINVAL |
796 * interface, connect will fail and errno will be set to EINVAL |
797 * or EHOSTUNREACH. When that happens, don't throw an exception, |
797 * or EHOSTUNREACH. When that happens, don't throw an exception, |
798 * just return false. |
798 * just return false. |