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:50 +0000 (10:55 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 24 Mar 2004 10:55:50 +0000 (10:55 +0000)
crypto/bio/bss_file.c

index 554474733fbcef6c5f6a8413ea1b20b560843158..4fe38ae1986dad717f3d47fcf5310ee97c352ce4 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_MSDOS)
+               int fd = fileno((FILE*)ptr);
                /* Set correct text/binary mode */
                if (num & BIO_FP_TEXT)
                        _setmode(fd,_O_TEXT);
@@ -236,6 +237,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