Skip to content

Commit

Permalink
start: s/backgrounded/daemonize/g
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 Sep 30, 2018
1 parent f377401 commit 4bb538c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/lxc/execute.c
Expand Up @@ -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);
}
8 changes: 4 additions & 4 deletions src/lxc/lxc.h
Expand Up @@ -49,25 +49,25 @@ 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
* @name : the name of the container
* @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
Expand Down
16 changes: 8 additions & 8 deletions src/lxc/start.c
Expand Up @@ -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;
Expand Down Expand Up @@ -1156,7 +1156,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();
Expand Down Expand Up @@ -1244,7 +1244,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);
Expand All @@ -1271,7 +1271,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)
Expand Down Expand Up @@ -1848,7 +1848,7 @@ static int lxc_spawn(struct lxc_handler *handler)

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;
Expand All @@ -1860,7 +1860,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");
Expand Down Expand Up @@ -1996,14 +1996,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,
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/start.h
Expand Up @@ -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;
Expand Down

0 comments on commit 4bb538c

Please sign in to comment.