summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2004-10-14 05:49:01 +0000
committerRichard Levitte <levitte@openssl.org>2004-10-14 05:49:01 +0000
commit9e57ab615ceef50dd42102dc3fe485376d9447d4 (patch)
tree715ca188c6bfde8a54554c9d6ea480a889826569
parentb16fee0aa7ea15fc4194cfd827938259f5304561 (diff)
Because libraries on Windows lack useful version information, the zlib
guys had to change the name to differentiate with older versions when a backward incompatibility came up. Of course, we need to adapt. This change simply tries to load the library through the newer name (ZLIB1) first, and if that fails, it tries the good old ZLIB.
-rw-r--r--crypto/comp/c_zlib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index 8c0876151a..345b59d75d 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -189,7 +189,17 @@ COMP_METHOD *COMP_zlib(void)
if (!zlib_loaded)
{
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
- zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
+ zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0);
+ if (!zlib_dso)
+ {
+ zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
+ if (zlib_dso)
+ {
+ /* Clear the errors from the first failed
+ DSO_load() */
+ ERR_clear_error();
+ }
+ }
#else
zlib_dso = DSO_load(NULL, "z", NULL, 0);
#endif