dlfcn: always define _GNU_SOURCE
[openssl.git] / crypto / dso / dso_dlfcn.c
index 5f2254806ca903d71d3f261d042db1345fcfbe4f..32386c6eaefa67dcd691eae4d26c0efde85dbf1b 100644 (file)
    that handle _GNU_SOURCE and other similar macros.  Defining it later
    is simply too late, because those headers are protected from re-
    inclusion.  */
-#ifdef __linux
-# ifndef _GNU_SOURCE
-#  define _GNU_SOURCE  /* make sure dladdr is declared */
-# endif
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE   /* make sure dladdr is declared */
 #endif
 
 #include <stdio.h>
@@ -153,11 +151,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
 #              endif
 #      endif
 #else
-#      ifdef OPENSSL_SYS_SUNOS
-#              define DLOPEN_FLAG 1
-#      else
-#              define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
-#      endif
+#      define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
 #endif
 
 /* For this DSO_METHOD, our meth_data STACK will contain;
@@ -464,7 +458,7 @@ static int dlfcn_pathbyaddr(void *addr,char *path,int sz)
                return len;
                }
 
-       ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror());
+       ERR_add_error_data(2, "dlfcn_pathbyaddr(): ", dlerror());
 #endif
        return -1;
        }