Skip to content

Commit

Permalink
conf: make is_execute a boolean
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed May 26, 2018
1 parent 3a0e314 commit 07c4ea3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lxc/conf.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/execute.c
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion src/lxc/start.c
Expand Up @@ -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);
Expand Down

0 comments on commit 07c4ea3

Please sign in to comment.