diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-05 07:15:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-05 07:15:59 +0000 |
commit | cb5b2fcc5245f86f074e17e161cd0c3eea1c68ac (patch) | |
tree | 68cdcf52bbda40d5ee4c5bf6ee545e547faed22d | |
parent | a28ed567862638871327047b3e70e5d77f263752 (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.
-rw-r--r-- | usr.bin/tmux/client.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 2068484ce66..3a61b131236 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.2 2009/06/05 07:15:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |