Don't define fd for platforms that do not use it, as some may not declare fileno...
authorRichard Levitte <levitte@openssl.org>
Wed, 24 Mar 2004 10:55:48 +0000 (10:55 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 24 Mar 2004 10:55:48 +0000 (10:55 +0000)
crypto/bio/bss_file.c

index d4c058a..667c2eb 100644 (file)
@@ -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