summaryrefslogtreecommitdiff
path: root/usr/src/cmd/nscd/nscd_frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/nscd/nscd_frontend.c')
-rw-r--r--usr/src/cmd/nscd/nscd_frontend.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/cmd/nscd/nscd_frontend.c b/usr/src/cmd/nscd/nscd_frontend.c
index 7ed5e71bca..ea86b6e742 100644
--- a/usr/src/cmd/nscd/nscd_frontend.c
+++ b/usr/src/cmd/nscd/nscd_frontend.c
@@ -22,6 +22,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
#include <stdlib.h>
@@ -89,6 +90,8 @@ server_tsd_bind(void *arg)
{
static void *value = 0;
+ (void) pthread_setname_np(pthread_self(), "server_tsd_bind");
+
/* disable cancellation to avoid hangs if server threads disappear */
(void) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
(void) thr_setspecific(server_key, value);
@@ -132,7 +135,8 @@ server_destroy(void *arg)
* get clearance
*/
int
-_nscd_get_clearance(sema_t *sema) {
+_nscd_get_clearance(sema_t *sema)
+{
if (sema_trywait(&common_sema) == 0) {
(void) thr_setspecific(lookup_state_key, NULL);
return (0);
@@ -151,7 +155,8 @@ _nscd_get_clearance(sema_t *sema) {
* release clearance
*/
int
-_nscd_release_clearance(sema_t *sema) {
+_nscd_release_clearance(sema_t *sema)
+{
int which;
(void) thr_getspecific(lookup_state_key, (void**)&which);
@@ -197,7 +202,7 @@ _nscd_restart_if_cfgfile_changed()
static timestruc_t last_nsswitch_modified = { 0 };
static timestruc_t last_resolv_modified = { -1, 0 };
static mutex_t restarting_lock = DEFAULTMUTEX;
- static int restarting = 0;
+ static int restarting = 0;
int restart = 0;
time_t now = time(NULL);
char *me = "_nscd_restart_if_cfgfile_changed";
@@ -1477,6 +1482,8 @@ rts_mon(void)
struct ifa_msghdr *ifam = &mbuf.ifam;
char *me = "rts_mon";
+ (void) pthread_setname_np(pthread_self(), me);
+
rt_sock = socket(PF_ROUTE, SOCK_RAW, 0);
if (rt_sock < 0) {
_NSCD_LOG(NSCD_LOG_FRONT_END, NSCD_LOG_LEVEL_ERROR)