From a00b1ede5403f1e38534cc3b232739f20b8567e9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 22 Apr 2010 15:51:01 +0000 Subject: Sho the pid in the the hello line. --- src/ChangeLog | 5 +++++ src/assuan-listen.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2222e74..3409bc8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-04-22 Werner Koch + + * assuan-listen.c (assuan_accept): Show the PID with the default + hello message. + 2010-04-19 Werner Koch * system-w32.c (is_socket): New. diff --git a/src/assuan-listen.c b/src/assuan-listen.c index c37c3a5..55ddd0a 100644 --- a/src/assuan-listen.c +++ b/src/assuan-listen.c @@ -112,7 +112,18 @@ assuan_accept (assuan_context_t ctx) else if (p) rc = assuan_write_line (ctx, p); else - rc = assuan_write_line (ctx, "OK Pleased to meet you"); + { + static char const okstr[] = "OK Pleased to meet you"; + pid_t apid = assuan_get_pid (ctx); + if (apid != ASSUAN_INVALID_PID) + { + char tmpbuf[50]; + snprintf (tmpbuf, sizeof tmpbuf, "%s, process %i", okstr, (int)apid); + rc = assuan_write_line (ctx, tmpbuf); + } + else + rc = assuan_write_line (ctx, okstr); + } if (rc) return rc; -- cgit v1.2.3