summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ldapcachemgr
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/ldapcachemgr')
-rw-r--r--usr/src/cmd/ldapcachemgr/cachemgr_change.c5
-rw-r--r--usr/src/cmd/ldapcachemgr/cachemgr_discovery.c7
-rw-r--r--usr/src/cmd/ldapcachemgr/cachemgr_getldap.c8
3 files changed, 19 insertions, 1 deletions
diff --git a/usr/src/cmd/ldapcachemgr/cachemgr_change.c b/usr/src/cmd/ldapcachemgr/cachemgr_change.c
index 85a15a1054..727851ffbc 100644
--- a/usr/src/cmd/ldapcachemgr/cachemgr_change.c
+++ b/usr/src/cmd/ldapcachemgr/cachemgr_change.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2018 Joyent, Inc.
*/
#include <strings.h>
@@ -33,6 +35,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <procfs.h>
+#include <pthread.h>
#include "cachemgr.h"
extern admin_t current_admin;
@@ -535,6 +538,8 @@ chg_cleanup_waiting_threads(void *arg)
pid_t pid;
int always = 1, waiting;
+ (void) pthread_setname_np(pthread_self(), "chg_cleanup_thr");
+
if (op == NULL) {
waiting = 1;
type = CLEANUP_ALL;
diff --git a/usr/src/cmd/ldapcachemgr/cachemgr_discovery.c b/usr/src/cmd/ldapcachemgr/cachemgr_discovery.c
index bb352ae7c4..6650c9c221 100644
--- a/usr/src/cmd/ldapcachemgr/cachemgr_discovery.c
+++ b/usr/src/cmd/ldapcachemgr/cachemgr_discovery.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2018 Joyent, Inc.
*/
#ifdef SLP
@@ -539,9 +541,12 @@ done:
* parameter 'r' should be a pointer to an unsigned int containing
* the requested interval at which the network should be queried.
*/
-void discover(void *r) {
+void
+discover(void *r) {
unsigned short reqrefresh = *((unsigned int *)r);
+ (void) pthread_setname_np(pthread_self(), "discover");
+
for (;;) {
find_all_contexts("ldap",
__cache_get_cfghandle,
diff --git a/usr/src/cmd/ldapcachemgr/cachemgr_getldap.c b/usr/src/cmd/ldapcachemgr/cachemgr_getldap.c
index 298e61fcb0..b9bc3f77b6 100644
--- a/usr/src/cmd/ldapcachemgr/cachemgr_getldap.c
+++ b/usr/src/cmd/ldapcachemgr/cachemgr_getldap.c
@@ -20,6 +20,8 @@
*/
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright 2018 Joyent, Inc.
*/
#include <assert.h>
@@ -1631,6 +1633,8 @@ getldap_serverInfo_op(info_op_t op, char *input, char **output)
static time_t prev_refresh = 0, next_refresh = 0;
ns_server_status_t changed = 0;
+ (void) pthread_setname_np(pthread_self(), "getldap_serverinfo");
+
if (current_admin.debug_level >= DBG_ALL) {
logit("getldap_serverInfo_op()...\n");
}
@@ -2542,6 +2546,8 @@ getldap_refresh()
int sig_done = 0;
int dbg_level;
+ (void) pthread_setname_np(pthread_self(), "getldap_refresh");
+
if (current_admin.debug_level >= DBG_ALL) {
logit("getldap_refresh()...\n");
}
@@ -2892,6 +2898,8 @@ remove_server_thread(void *arg)
int up;
rm_svr_t rms;
+ (void) pthread_setname_np(pthread_self(), "remove_server");
+
up = contact_server(addr);
rms.addr = addr;