]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/daemon.c
Silently ignore if back-ldif is not present
[openldap] / servers / slapd / daemon.c
index 17122347577d820caa66eb702dcd9c7c0724da1f..2893a905f90c1f05de7eb85f2332dd0cd2605439 100644 (file)
@@ -978,8 +978,14 @@ static int slap_open_listener(
 #endif
 #ifdef LDAP_PF_LOCAL
                case AF_LOCAL:
-                       addrlen = sizeof(struct sockaddr_un);
-                       break;
+#ifdef LOCAL_CREDS
+               {
+                       int one = 1;
+                       setsockopt(l.sl_sd, 0, LOCAL_CREDS, &one, sizeof one);
+               }
+#endif
+               addrlen = sizeof(struct sockaddr_un);
+               break;
 #endif
                }
 
@@ -1666,7 +1672,7 @@ slapd_daemon_task(
                }
                ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
 
-               if ( cat != NULL ) {
+               if ( cat && cat->tv_sec ) {
                        time_t diff = difftime( cat->tv_sec, now );
                        if ( diff == 0 )
                                diff = tdelta;
@@ -1714,10 +1720,12 @@ slapd_daemon_task(
 
                case 0:         /* timeout - let threads run */
                        ebadf = 0;
+#ifndef HAVE_YIELDING_SELECT
                        Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n",
                            0, 0, 0 );
 
                        ldap_pvt_thread_yield();
+#endif
                        continue;
 
                default:        /* something happened - deal with it */
@@ -1770,7 +1778,9 @@ slapd_daemon_task(
 
                /* bypass the following tests if no descriptors left */
                if ( ns <= 0 ) {
+#ifndef HAVE_YIELDING_SELECT
                        ldap_pvt_thread_yield();
+#endif
                        continue;
                }
 
@@ -1966,7 +1976,9 @@ slapd_daemon_task(
                }
 #endif /* SLAP_EVENTS_ARE_INDEXED */
 
+#ifndef HAVE_YIELDING_SELECT
                ldap_pvt_thread_yield();
+#endif
        }
 
        if( slapd_shutdown == 1 ) {