o_fopen.c: compensate for e_os.h omission.
authorAndy Polyakov <appro@openssl.org>
Wed, 21 Mar 2018 10:16:50 +0000 (11:16 +0100)
committerAndy Polyakov <appro@openssl.org>
Thu, 22 Mar 2018 10:48:43 +0000 (11:48 +0100)
At earlier point e_os.h was omitted from a number of headers (in order
to emphasize OS neutrality), but this affected o_fopen.c, which is not
OS-neutral, and contains some DJGPP-specific code.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5708)

crypto/o_fopen.c

index 951d034ddaae05cc30d0d3af4aec2d01558c07be..1b4028c9a81a807e35bc8ca58f36e4718d1b2108 100644 (file)
@@ -15,6 +15,9 @@
 # ifdef _WIN32
 #  include <windows.h>
 # endif
+# ifdef __DJGPP__
+#  include <unistd.h>
+# endif
 
 FILE *openssl_fopen(const char *filename, const char *mode)
 {
@@ -64,7 +67,7 @@ FILE *openssl_fopen(const char *filename, const char *mode)
     {
         char *newname = NULL;
 
-        if (!HAS_LFN_SUPPORT(filename)) {
+        if (pathconf(filename, _PC_NAME_MAX) <= 12) {  /* 8.3 file system? */
             char *iterator;
             char lastchar;