summaryrefslogtreecommitdiff
path: root/nscd/connections.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index a9cdbd4cd8..0ca7585f14 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -21,7 +21,6 @@
#include <alloca.h>
#include <assert.h>
#include <atomic.h>
-#include <dlfcn.h>
#include <error.h>
#include <errno.h>
#include <fcntl.h>
@@ -43,7 +42,6 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
-#include <gnu/lib-names.h>
#include "nscd.h"
#include "dbg_log.h"
@@ -1473,39 +1471,19 @@ start_threads (void)
pthread_condattr_t condattr;
pthread_condattr_init (&condattr);
-#if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
+#if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0 \
+ && defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
/* Determine whether the monotonous clock is available. */
struct timespec dummy;
# if _POSIX_MONOTONIC_CLOCK == 0
if (sysconf (_SC_MONOTONIC_CLOCK) > 0)
# endif
- {
-# if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
-# if _POSIX_CLOCK_SELECTION == 0
- if (sysconf (_SC_CLOCK_SELECTION) > 0)
-# endif
- if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0
- && pthread_condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
- timeout_clock = CLOCK_MONOTONIC;
-# elif _POSIX_THREADS > 0
- if (sysconf (_SC_CLOCK_SELECTION) > 0)
- {
- void *h = __libc_dlopen (LIBPTHREAD_SO);
- int (*condattr_setclock) (pthread_condattr_t *, __clockid_t) = NULL;
-
- if (h != NULL)
- condattr_setclock = __libc_dlsym (h, "pthread_condattr_setclock");
-
- if (condattr_setclock
- && clock_getres (CLOCK_MONOTONIC, &dummy) == 0
- && condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
- timeout_clock = CLOCK_MONOTONIC;
-
- if (h != NULL)
- __libc_dlclose (h);
- }
+# if _POSIX_CLOCK_SELECTION == 0
+ if (sysconf (_SC_CLOCK_SELECTION) > 0)
# endif
- }
+ if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0
+ && pthread_condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
+ timeout_clock = CLOCK_MONOTONIC;
#endif
pthread_cond_init (&readylist_cond, &condattr);
@@ -1570,6 +1548,7 @@ start_threads (void)
main_loop_poll ();
}
+
/* Look up the uid, gid, and supplementary groups to run nscd as. When
this function is called, we are not listening on the nscd socket yet so
we can just use the ordinary lookup functions without causing a lockup */