]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/openssl.c
Apply patch from Marco van Wieringen <mvw@planets.elm.net>
[bacula/bacula] / bacula / src / lib / openssl.c
index 014ed4026bbc27114a22597109cc5a0d353a0b7b..994b29ebcb0ed25caaa0c11bc81450571e99b86b 100644 (file)
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -82,7 +82,7 @@ void openssl_post_errors(JCR *jcr, int code, const char *errstring)
    while((sslerr = ERR_get_error()) != 0) {
       /* Acquire the human readable string */
       ERR_error_string_n(sslerr, buf, sizeof(buf));
-      Dmsg3(100, "jcr=%p %s: ERR=%s\n", jcr, errstring, buf);
+      Dmsg3(50, "jcr=%p %s: ERR=%s\n", jcr, errstring, buf);
       Qmsg2(jcr, M_ERROR, 0, "%s: ERR=%s\n", errstring, buf);
    }
 }
@@ -94,13 +94,17 @@ void openssl_post_errors(JCR *jcr, int code, const char *errstring)
  */
 static unsigned long get_openssl_thread_id(void)
 {
-   /* Comparison without use of pthread_equal() is mandated by the OpenSSL API */
+#ifdef HAVE_WIN32
+   return (unsigned long)getpid();
+#else
    /*
-    * Note that this creates problems with the new Win32 pthreads
-    *   emulation code, which defines pthread_t as a structure. For
-    *   this reason, we continue to use a very old implementation.
+    * Comparison without use of pthread_equal() is mandated by the OpenSSL API 
+    *
+    * Note: this creates problems with the new Win32 pthreads
+    *   emulation code, which defines pthread_t as a structure.
     */
    return ((unsigned long)pthread_self());
+#endif
 }
 
 /*