diff options
Diffstat (limited to '')
-rw-r--r-- | scd/ChangeLog | 4 | ||||
-rw-r--r-- | scd/command.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index 56aca1fb7..382961dbc 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,7 @@ +2007-10-02 Werner Koch <[email protected]> + + * command.c (cmd_getinfo): Add "pid" subcommand. + 2007-10-01 Werner Koch <[email protected]> * scdaemon.c (create_server_socket): Use Assuan socket wrappers diff --git a/scd/command.c b/scd/command.c index e65262d06..361b13f51 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1452,6 +1452,7 @@ cmd_unlock (assuan_context_t ctx, char *line) Supported values of WHAT are: version - Return the version of the program. + pid - Return the process id of the server. socket_name - Return the name of the socket. @@ -1476,6 +1477,13 @@ cmd_getinfo (assuan_context_t ctx, char *line) const char *s = VERSION; rc = assuan_send_data (ctx, s, strlen (s)); } + else if (!strcmp (line, "pid")) + { + char numbuf[50]; + + snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ()); + rc = assuan_send_data (ctx, numbuf, strlen (numbuf)); + } else if (!strcmp (line, "socket_name")) { const char *s = scd_get_socket_name (); |