Unconditionally include BIO_set_fd and BIO_get_fd These functions are just wrappers over BIO_ctrls, shared between the fd and socket BIOs. Though we don't currently support one, it is conceivable that there would be a platform with socket BIOs but not fd BIOs. In that case, the BIO_get_fd function would still be useful to implement SSL_get_rfd. (And someone could conceivably implement it in another BIO.) Bug: 629 Change-Id: I7ac3561f76af86af32d70b1c6265c4caeaecb129 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61727 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com>
diff --git a/crypto/bio/fd.c b/crypto/bio/fd.c index aac8bcb..c128e81 100644 --- a/crypto/bio/fd.c +++ b/crypto/bio/fd.c
@@ -268,6 +268,8 @@ const BIO_METHOD *BIO_s_fd(void) { return &methods_fdp; } +#endif // OPENSSL_NO_POSIX_IO + int BIO_set_fd(BIO *bio, int fd, int close_flag) { return (int)BIO_int_ctrl(bio, BIO_C_SET_FD, close_flag, fd); } @@ -275,5 +277,3 @@ int BIO_get_fd(BIO *bio, int *out_fd) { return (int)BIO_ctrl(bio, BIO_C_GET_FD, 0, (char *) out_fd); } - -#endif // OPENSSL_NO_POSIX_IO