summaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
Diffstat (limited to 'nscd')
-rw-r--r--nscd/connections.c37
-rw-r--r--nscd/nscd.c4
-rw-r--r--nscd/nscd_conf.c5
3 files changed, 9 insertions, 37 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 */
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 76d2080309..e6921c2ceb 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -128,10 +128,6 @@ extern void sighup_handler(int signum);
/* True if only statistics are requested. */
static bool get_stats;
-#ifdef atomic_init_nscd
-atomic_init_nscd
-#endif
-
int
main (int argc, char **argv)
{
diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c
index 2bca368de6..d21f2fc501 100644
--- a/nscd/nscd_conf.c
+++ b/nscd/nscd_conf.c
@@ -230,10 +230,7 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
if (strcmp (arg2, "no") == 0)
dbs[cnt].shared = 0;
else if (strcmp (arg2, "yes") == 0)
-#ifndef atomic_supports_shared
-#define atomic_supports_shared 1
-#endif
- dbs[cnt].shared = atomic_supports_shared;
+ dbs[cnt].shared = 1;
break;
}
if (cnt == lastdb)