From: Christian Brauner Date: Fri, 21 Sep 2018 10:24:24 +0000 (+0200) Subject: start: s/backgrounded/daemonize/g X-Git-Tag: lxc-3.1.0~105^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb955810ef4682069a53c73b2775a5994f858928;p=thirdparty%2Flxc.git start: s/backgrounded/daemonize/g Signed-off-by: Christian Brauner --- diff --git a/src/lxc/execute.c b/src/lxc/execute.c index dc23bb3ea..163f3f473 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -150,12 +150,12 @@ static struct lxc_operations execute_start_ops = { int lxc_execute(const char *name, char *const argv[], int quiet, struct lxc_handler *handler, const char *lxcpath, - bool backgrounded, int *error_num) + bool daemonize, int *error_num) { struct execute_args args = {.argv = argv, .quiet = quiet}; TRACE("Doing lxc_execute"); handler->conf->is_execute = true; return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath, - backgrounded, error_num); + daemonize, error_num); } diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index c2a150cf4..237d74750 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -49,12 +49,12 @@ struct lxc_handler; * @name : the name of the container * @argv : an array of char * corresponding to the commande line * @conf : configuration - * @backgrounded : whether or not the container is daemonized + * @daemonize : whether or not the container is daemonized * Returns 0 on success, < 0 otherwise */ extern int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler, const char *lxcpath, - bool backgrounded, int *error_num); + bool daemonize, int *error_num); /* * Start the specified command inside an application container @@ -62,12 +62,12 @@ extern int lxc_start(const char *name, char *const argv[], * @argv : an array of char * corresponding to the commande line * @quiet : if != 0 then lxc-init won't produce any output * @conf : configuration - * @backgrounded : whether or not the container is daemonized + * @daemonize : whether or not the container is daemonized * Returns 0 on success, < 0 otherwise */ extern int lxc_execute(const char *name, char *const argv[], int quiet, struct lxc_handler *handler, const char *lxcpath, - bool backgrounded, int *error_num); + bool daemonize, int *error_num); /* * Close the fd associated with the monitoring diff --git a/src/lxc/start.c b/src/lxc/start.c index 8d3a7ced5..6d289dadd 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -461,7 +461,7 @@ static int lxc_serve_state_socket_pair(const char *name, { ssize_t ret; - if (!handler->backgrounded || + if (!handler->daemonize || handler->state_socket_pair[1] < 0 || state == STARTING) return 0; @@ -1168,7 +1168,7 @@ static int do_start(void *data) * means that migration won't work, but at least we won't spew output * where it isn't wanted. */ - if (handler->backgrounded && !handler->conf->autodev) { + if (handler->daemonize && !handler->conf->autodev) { ret = access(path, F_OK); if (ret != 0) { devnull_fd = open_devnull(); @@ -1256,7 +1256,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) + if (handler->daemonize || !handler->conf->is_execute) ret = set_stdfds(handler->conf->console.slave); else ret = lxc_terminal_set_stdfds(handler->conf->console.slave); @@ -1283,7 +1283,7 @@ static int do_start(void *data) close(handler->sigfd); - if (handler->conf->console.slave < 0 && handler->backgrounded) { + if (handler->conf->console.slave < 0 && handler->daemonize) { if (devnull_fd < 0) { devnull_fd = open_devnull(); if (devnull_fd < 0) @@ -1945,7 +1945,7 @@ out_sync_fini: int __lxc_start(const char *name, struct lxc_handler *handler, struct lxc_operations* ops, void *data, const char *lxcpath, - bool backgrounded, int *error_num) + bool daemonize, int *error_num) { int ret, status; struct lxc_conf *conf = handler->conf; @@ -1957,7 +1957,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler, } handler->ops = ops; handler->data = data; - handler->backgrounded = backgrounded; + handler->daemonize = daemonize; if (!attach_block_device(handler->conf)) { ERROR("Failed to attach block device"); @@ -2093,14 +2093,14 @@ static struct lxc_operations start_ops = { }; int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler, - const char *lxcpath, bool backgrounded, int *error_num) + const char *lxcpath, bool daemonize, int *error_num) { struct start_args start_arg = { .argv = argv, }; TRACE("Doing lxc_start"); - return __lxc_start(name, handler, &start_ops, &start_arg, lxcpath, backgrounded, error_num); + return __lxc_start(name, handler, &start_ops, &start_arg, lxcpath, daemonize, error_num); } static void lxc_destroy_container_on_signal(struct lxc_handler *handler, diff --git a/src/lxc/start.h b/src/lxc/start.h index aaa731077..bcb852e8b 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -98,7 +98,7 @@ struct lxc_handler { bool am_root; /* Indicates whether should we close std{in,out,err} on start. */ - bool backgrounded; + bool daemonize; /* The child's pid. */ pid_t pid;