提交 e703b465 编写于 作者: R Richard Levitte

Don't define fd for platforms that do not use it, as some may not declare fileno() properly

上级 0fa793bc
......@@ -214,13 +214,14 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
b->ptr=(char *)ptr;
b->init=1;
{
int fd = fileno((FILE*)ptr);
#if defined(OPENSSL_SYS_WINDOWS)
int fd = fileno((FILE*)ptr);
if (num & BIO_FP_TEXT)
_setmode(fd,_O_TEXT);
else
_setmode(fd,_O_BINARY);
#elif defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB)
int fd = fileno((FILE*)ptr);
/* Under CLib there are differences in file modes
*/
if (num & BIO_FP_TEXT)
......@@ -228,6 +229,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
else
_setmode(fd,O_BINARY);
#elif defined(OPENSSL_SYS_MSDOS)
int fd = fileno((FILE*)ptr);
/* Set correct text/binary mode */
if (num & BIO_FP_TEXT)
_setmode(fd,_O_TEXT);
......@@ -243,6 +245,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
_setmode(fd,_O_BINARY);
}
#elif defined(OPENSSL_SYS_OS2)
int fd = fileno((FILE*)ptr);
if (num & BIO_FP_TEXT)
setmode(fd, O_TEXT);
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册