From 97587dd24496c8a9acb457b2accc665b7adf7efb Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 20 Dec 2014 10:18:27 -0500 Subject: [PATCH] GETINFO: prefix filename with / if it owns the lock. Use / since it is not allowed in a filename. This can make it easier to determine which client to KILL. --- doc/pwmd.html | 4 ++-- src/commands.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/pwmd.html b/doc/pwmd.html index 7e624409..53f6df97 100644 --- a/doc/pwmd.html +++ b/doc/pwmd.html @@ -999,8 +999,8 @@ documents via a status message. CLIENTS returns the number of connected clients via a status message or a list of connected clients when the --verbose parameter is used. The list contains space delimited fields specifying the thread ID (prefixed with * if self), client -name and opened file and is always -returned with a data response. PID returns the process ID +name and opened file (prefixed with / if it owns the file lock) and is +always returned with a data response. PID returns the process ID number of the server via a data response. VERSION returns the server version number and compile-time features with a data response with each being space delimited. LAST_ERROR returns a detailed description of diff --git a/src/commands.c b/src/commands.c index 742aa9a2..b54bffd3 100644 --- a/src/commands.c +++ b/src/commands.c @@ -4392,10 +4392,12 @@ send_client_list (assuan_context_t ctx) struct client_thread_s *thd = slist_nth_data (cn_thread_list, i); pthread_t self = pthread_self (); - if (!strv_printf (&list, "%s%p %s %s %s", + if (!strv_printf (&list, "%s%p %s %s%s %s", self == thd->tid ? "*" : "", thd->tid, thd->name ? thd->name : "-", + thd->cl && thd->cl->flags & FLAG_HAS_LOCK ? "/" + : "", thd->cl && thd->cl->filename ? thd->cl->filename : "-", #ifdef WITH_GNUTLS @@ -4673,8 +4675,8 @@ init_commands () "connected clients via a status message or a list of connected clients when " "the @option{--verbose} parameter is used. The list contains space delimited " "fields specifying the thread ID (prefixed with @code{*} if self), client " -"name and opened file and is always " -"returned with a data response. @var{PID} returns the process ID " +"name and opened file (prefixed with @code{/} if it owns the file lock) and is " +"always returned with a data response. @var{PID} returns the process ID " "number of the server via a data response. @var{VERSION} returns the server " "version number and compile-time features with a data response with each " "being space delimited. @var{LAST_ERROR} returns a detailed description of " -- 2.11.4.GIT