mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-13 09:28:14 +01:00
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.
This commit is contained in:
parent
74749e8705
commit
1156467726
6
client.c
6
client.c
@ -46,6 +46,11 @@ client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
|
|||||||
int mode;
|
int mode;
|
||||||
struct buffer *b;
|
struct buffer *b;
|
||||||
char *name;
|
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 (lstat(path, &sb) != 0) {
|
||||||
if (start_server && errno == ENOENT) {
|
if (start_server && errno == ENOENT) {
|
||||||
@ -135,7 +140,6 @@ client_main(struct client_ctx *cctx)
|
|||||||
siginit();
|
siginit();
|
||||||
|
|
||||||
logfile("client");
|
logfile("client");
|
||||||
setproctitle("client");
|
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
xtimeout = INFTIM;
|
xtimeout = INFTIM;
|
||||||
|
Loading…
Reference in New Issue
Block a user