Unverified Commit 2339fce5 by Stéphane Graber Committed by GitHub

Merge pull request #2631 from brauner/2018-09-20/rename_backgrounded

start: s/backgrounded/daemonize/g
parents 2eea2607 bb955810
......@@ -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);
}
......@@ -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
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment