summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-05 07:15:58 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-05 07:15:58 +0000
commit1156467726a21f2126e0b382223118298c623b22 (patch)
tree6948f9fe55fc093a977ad0cf9aa957baabed9097 /client.c
parent74749e8705a49ddda7a742f44bae5865be3f7a70 (diff)
Call setproctitle earlier in the client, and include the socket name. Makes it
easier to match client to server in ps/pgrep when using several servers.
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/client.c b/client.c
index 12041eed..226f22fe 100644
--- a/client.c
+++ b/client.c
@@ -46,6 +46,11 @@ client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
int mode;
struct buffer *b;
char *name;
+ char rpathbuf[MAXPATHLEN];
+
+ if (realpath(path, rpathbuf) == NULL)
+ strlcpy(rpathbuf, path, sizeof rpathbuf);
+ setproctitle("client (%s)", rpathbuf);
if (lstat(path, &sb) != 0) {
if (start_server && errno == ENOENT) {
@@ -135,7 +140,6 @@ client_main(struct client_ctx *cctx)
siginit();
logfile("client");
- setproctitle("client");
error = NULL;
xtimeout = INFTIM;