1 // Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include <openssl/bio.h> 16 17 #include <errno.h> 18 19 #include "internal.h" 20 21 bio_errno_should_retry(int return_value)22int bio_errno_should_retry(int return_value) { 23 if (return_value != -1) { 24 return 0; 25 } 26 27 return 28 #ifdef EWOULDBLOCK 29 errno == EWOULDBLOCK || 30 #endif 31 #ifdef ENOTCONN 32 errno == ENOTCONN || 33 #endif 34 #ifdef EINTR 35 errno == EINTR || 36 #endif 37 #ifdef EAGAIN 38 errno == EAGAIN || 39 #endif 40 #ifdef EPROTO 41 errno == EPROTO || 42 #endif 43 #ifdef EINPROGRESS 44 errno == EINPROGRESS || 45 #endif 46 #ifdef EALREADY 47 errno == EALREADY || 48 #endif 49 0; 50 } 51