From 07c4ea310d0f62f163bbfbb829752827691e2cd5 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 26 May 2018 12:50:03 +0200 Subject: [PATCH] conf: make is_execute a boolean Signed-off-by: Christian Brauner --- src/lxc/conf.h | 2 +- src/lxc/execute.c | 2 +- src/lxc/start.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index c4ae2324d..758b36667 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -214,10 +214,10 @@ struct lxc_state_client { struct lxc_conf { /* Pointer to the name of the container. Do not free! */ const char *name; - int is_execute; char *fstab; unsigned int tty; unsigned int pts; + bool is_execute; int reboot; signed long personality; struct utsname *utsname; diff --git a/src/lxc/execute.c b/src/lxc/execute.c index d895e5be9..1a87b2321 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -152,7 +152,7 @@ int lxc_execute(const char *name, char *const argv[], int quiet, struct execute_args args = {.argv = argv, .quiet = quiet}; TRACE("Doing lxc_execute"); - handler->conf->is_execute = 1; + handler->conf->is_execute = true; return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath, backgrounded, error_num); } diff --git a/src/lxc/start.c b/src/lxc/start.c index 94abff377..21a1140e6 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1247,7 +1247,7 @@ static int do_start(void *data) * make sure that that pty is stdin,stdout,stderr. */ if (handler->conf->console.slave >= 0) { - if (handler->backgrounded || handler->conf->is_execute == 0) + if (handler->backgrounded || !handler->conf->is_execute) ret = set_stdfds(handler->conf->console.slave); else ret = lxc_terminal_set_stdfds(handler->conf->console.slave);