]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/main.c
fix previous commit
[openldap] / servers / slurpd / main.c
index 19949128d31d294996029b9619ad24eadaa91e8a..41d7fc3f2f35e2c762bfadfd03c31baa7402ef6c 100644 (file)
@@ -22,9 +22,9 @@
 
 #include "portable.h"
 
-#include <ac/stdlib.h>
-
 #include <stdio.h>
+#include <sys/stat.h>
+#include <ac/stdlib.h>
 
 #include "slurp.h"
 #include "globals.h"
@@ -111,8 +111,10 @@ main(
      * Detach from the controlling terminal
      * unless the -d flag is given or in one-shot mode.
      */
+#ifndef HAVE_WINSOCK
     if ( ! (sglob->no_detach || sglob->one_shot_mode) )
        lutil_detach( 0, 0 );
+#endif
 
     /*
      * Start the main file manager thread (in fm.c).
@@ -120,8 +122,13 @@ main(
     if ( ldap_pvt_thread_create( &(sglob->fm_tid),
                0, fm, (void *) NULL ) != 0 )
        {
+#ifdef NEW_LOGGING
+       LDAP_LOG ( SLURPD, ERR,
+               "main: file manager ldap_pvt_thread_create failed\n" , 0, 0, 0 );
+#else
        Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
                0, 0, 0 );
+#endif
        exit( EXIT_FAILURE );
 
     }
@@ -157,7 +164,11 @@ main(
     /* destroy the thread package */
     ldap_pvt_thread_destroy();
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( SLURPD, RESULTS, "main: slurpd terminated\n", 0, 0, 0 );
+#else
     Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 );
+#endif
        return 0;
 #endif /* !NO_THREADS */
 }