mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
conmux: Fix conmux client name
There are other users than myself of this, so don't hard code the conmux id as "bjorn" but rather base it on $USER. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
7
conmux.c
7
conmux.c
@@ -231,11 +231,16 @@ void *conmux_open(struct device *dev)
|
||||
struct conmux *conmux;
|
||||
struct hostent *hent;
|
||||
const char *service = dev->cdb_serial;
|
||||
const char *user;
|
||||
ssize_t n;
|
||||
char req[256];
|
||||
int ret;
|
||||
int fd;
|
||||
|
||||
user = getenv("USER");
|
||||
if (!user)
|
||||
user = "unknown";
|
||||
|
||||
ret = registry_lookup(service, &lookup);
|
||||
if (ret)
|
||||
exit(1);
|
||||
@@ -262,7 +267,7 @@ void *conmux_open(struct device *dev)
|
||||
if (ret < 0)
|
||||
err(1, "failed to connect to conmux instance");
|
||||
|
||||
ret = snprintf(req, sizeof(req), "CONNECT id=bjorn to=console\n");
|
||||
ret = snprintf(req, sizeof(req), "CONNECT id=cdba:%s to=console\n", user);
|
||||
if (ret >= sizeof(req))
|
||||
errx(1, "unable to fit connect request in buffer");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user