From 728d02983e359e774fd2b073621f0ddaced88754 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Sun, 25 Sep 2016 10:12:31 +0800 Subject: [PATCH] remove local variable path Signed-off-by: Lai Jiangshan --- src/exec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/exec.c b/src/exec.c index b3e0dcf..0197ae1 100644 --- a/src/exec.c +++ b/src/exec.c @@ -339,7 +339,7 @@ static int hyper_setup_exec_tty(struct hyper_exec *e) { int unlock = 0; int ptymaster; - char ptmx[512], path[512]; + char ptmx[512]; if (!e->tty) { // don't use tty for stdio return hyper_setup_exec_notty(e); @@ -356,12 +356,7 @@ static int hyper_setup_exec_tty(struct hyper_exec *e) e->stderrfd = errpipe[1]; } - if (sprintf(path, "/tmp/hyper/%s/devpts/", e->id) < 0) { - fprintf(stderr, "get ptmx path failed\n"); - return -1; - } - - if (sprintf(ptmx, "%s/ptmx", path) < 0) { + if (sprintf(ptmx, "/tmp/hyper/%s/devpts/ptmx", e->id) < 0) { fprintf(stderr, "get ptmx path failed\n"); return -1; }