From 6a5656212089ed08cc2cfa17ab3fffe9fcc1ae83 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 6 Apr 2016 12:06:04 +0800 Subject: [PATCH] require exec->seq be set, we can't handle zero seq well Signed-off-by: Lai Jiangshan --- src/exec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exec.c b/src/exec.c index 873aa6e..e2644ab 100644 --- a/src/exec.c +++ b/src/exec.c @@ -227,8 +227,8 @@ int hyper_setup_exec_tty(struct hyper_exec *e) char ptmx[512], path[512]; if (e->seq == 0) { - e->ptyfd = open("/dev/null", O_RDWR | O_NOCTTY | O_CLOEXEC); - goto done; + fprintf(stderr, "e->seq should be set\n"); + return -1; } if (!e->tty) { // don't use tty for stdio @@ -289,7 +289,6 @@ int hyper_setup_exec_tty(struct hyper_exec *e) e->stdinev.fd = ptymaster; e->stdoutev.fd = dup(ptymaster); -done: if (e->errseq == 0) { e->stderrev.fd = dup(e->stdoutev.fd); }