/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#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
}
}
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;
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 */
/* bypass the following tests if no descriptors left */
if ( ns <= 0 ) {
+#ifndef HAVE_YIELDING_SELECT
ldap_pvt_thread_yield();
+#endif
continue;
}
}
slapd_close( wd );
}
+ SLAP_EVENT_CLR_WRITE( wd );
}
for ( i = 0; nrfds > 0; i++ )
}
#endif /* SLAP_EVENTS_ARE_INDEXED */
+#ifndef HAVE_YIELDING_SELECT
ldap_pvt_thread_yield();
+#endif
}
if( slapd_shutdown == 1 ) {