]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/debug.c
Fix ldaps / TLS processing...
[openldap] / libraries / liblutil / debug.c
index ddb30ed96b9b50298dbaa8b558f1546658c9ae97..2ebce49700b6a3b73b292bab4a2d00a212c0f488 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1996, 1998 by Internet Software Consortium.
  *
 
 #include "ldap_log.h"
 #include "ldap_defaults.h"
+#include "lber.h"
 
 static FILE *log_file;
 
 int lutil_debug_file( FILE *file )
 {
-       log_file = log_file;
+       log_file = file;
+       ber_set_option( NULL, LBER_OPT_LOG_PRINT_FILE, file );
 
        return 0;
 }
@@ -52,9 +59,10 @@ void (lutil_debug)( int level, int debug, const char *fmt, ... )
 
                if ( log_file == NULL )
                        return;
+
+           ber_set_option( NULL, LBER_OPT_LOG_PRINT_FILE, file );
        }
 #endif
-
        va_start( vl, fmt );
 
 #ifdef HAVE_VSNPRINTF
@@ -69,6 +77,6 @@ void (lutil_debug)( int level, int debug, const char *fmt, ... )
                fflush( log_file );
        }
 
-    puts(buffer );
+    fputs( buffer, stderr );
        va_end( vl );
 }