mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-24 20:05:47 +02:00
Be more clever about picking window name.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: osdep-linux.c,v 1.1 2009-01-20 19:35:03 nicm Exp $ */
|
||||
/* $Id: osdep-linux.c,v 1.2 2009-01-26 22:57:19 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -27,16 +27,23 @@
|
||||
#include "tmux.h"
|
||||
|
||||
char *
|
||||
get_argv0(pid_t pgrp)
|
||||
get_argv0(int fd, unused char *tty)
|
||||
{
|
||||
FILE *f;
|
||||
char *path, *buf;
|
||||
size_t len;
|
||||
int ch;
|
||||
pid_t pgrp;
|
||||
|
||||
if ((pgrp = tcgetpgrp(fd)) == -1)
|
||||
return (NULL);
|
||||
|
||||
xasprintf(&path, "/proc/%lld/cmdline", (long long) pgrp);
|
||||
if ((f = fopen(path, "r")) == NULL)
|
||||
if ((f = fopen(path, "r")) == NULL) {
|
||||
xfree(path);
|
||||
return (NULL);
|
||||
}
|
||||
xfree(path);
|
||||
|
||||
len = 0;
|
||||
buf = NULL;
|
||||
|
Reference in New Issue
Block a user