diff options
author | Werner Koch <wk@gnupg.org> | 2007-10-02 18:30:58 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2007-10-02 18:30:58 +0200 |
commit | ed7d2d72c64ea23d65d014511a4f0cf74dc144d6 (patch) | |
tree | 70a32592c35e19ed28029bf85a627791b21b0c46 /agent | |
parent | Use Assuan socket wrapper calls. (diff) | |
download | gnupg2-ed7d2d72c64ea23d65d014511a4f0cf74dc144d6.tar.xz gnupg2-ed7d2d72c64ea23d65d014511a4f0cf74dc144d6.zip |
Extended gpg-connect-agent.
New "GETINFO pid" command for scdaemon and gpg-agent.
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 4 | ||||
-rw-r--r-- | agent/command.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index 7b46155fe..28ddb6688 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,7 @@ +2007-10-02 Werner Koch <wk@g10code.com> + + * command.c (cmd_getinfo): Add "pid" subcommand. + 2007-10-01 Werner Koch <wk@g10code.com> * agent.h (struct server_control_s): Remove unused CONNECTION_FD. diff --git a/agent/command.c b/agent/command.c index b816fac3e..9be814880 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1344,6 +1344,7 @@ cmd_reloadagent (assuan_context_t ctx, char *line) Supported values for 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. ssh_socket_name - Return the name of the ssh socket. @@ -1358,6 +1359,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 = get_agent_socket_name (); |