Skip to content

Commit

Permalink
criu: do_restore()
Browse files Browse the repository at this point in the history
thread-safety: s/exit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent a7d1eef commit 28eafc4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lxc/criu.c
Expand Up @@ -823,8 +823,9 @@ static bool restore_net_info(struct lxc_container *c)
return !has_error;
}

// do_restore never returns, the calling process is used as the
// monitor process. do_restore calls exit() if it fails.
/* do_restore never returns, the calling process is used as the monitor process.
* do_restore calls _exit() if it fails.
*/
static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_opts *opts, char *criu_version)
{
int fd, ret;
Expand Down Expand Up @@ -1040,7 +1041,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
if (ret)
lxc_abort(c->name, handler);
lxc_fini(c->name, handler);
exit(ret);
_exit(ret);
}

out_fini_handler:
Expand All @@ -1065,7 +1066,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
close(status_pipe);
}

exit(1);
_exit(EXIT_FAILURE);
}

static int save_tty_major_minor(char *directory, struct lxc_container *c, char *tty_id, int len)
Expand Down

0 comments on commit 28eafc4

Please sign in to comment.