Keep disclaiming 16-bit platform support. For now remove WIN16 references
[openssl.git] / crypto / bio / bss_file.c
index ed6ee6cabba0b0e253897a5dbae75fa0eac7eb82..9e161b17f508076ceeea2f34e74a6098e76f7796 100644 (file)
@@ -127,7 +127,7 @@ BIO *BIO_new_file(const char *filename, const char *mode)
                        BIOerr(BIO_F_BIO_NEW_FILE,ERR_R_SYS_LIB);
                return(NULL);
                }
-       if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
+       if ((ret=BIO_new(BIO_s_file())) == NULL)
                return(NULL);
 
        BIO_clear_flags(ret,BIO_FLAGS_UPLINK); /* we did fopen -> we disengage UPLINK */
@@ -279,8 +279,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
                        _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
-         */
+               /* Under CLib there are differences in file modes */
                if (num & BIO_FP_TEXT)
                        _setmode(fd,O_TEXT);
                else
@@ -301,7 +300,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
                        else
                                _setmode(fd,_O_BINARY);
                        }
-#elif defined(OPENSSL_SYS_OS2)
+#elif defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_WIN32_CYGWIN)
                int fd = fileno((FILE*)ptr);
                if (num & BIO_FP_TEXT)
                        setmode(fd, O_TEXT);
@@ -396,7 +395,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
        int ret=0;
 
        buf[0]='\0';
-       if (b->flags&BIO_FLAGS_UPLINK)
+       if (bp->flags&BIO_FLAGS_UPLINK)
                UP_fgets(buf,size,bp->ptr);
        else
                fgets(buf,size,(FILE *)bp->ptr);