2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

crtools: add init_opts()

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Ruslan Kuprieiev 2013-10-30 02:48:38 +04:00 committed by Pavel Emelyanov
parent b28f03aaee
commit fdbedf5a88
2 changed files with 13 additions and 4 deletions

View File

@ -33,6 +33,16 @@
struct cr_options opts; struct cr_options opts;
void init_opts(void)
{
memset(&opts, 0, sizeof(opts));
/* Default options */
opts.final_state = TASK_DEAD;
INIT_LIST_HEAD(&opts.veth_pairs);
INIT_LIST_HEAD(&opts.scripts);
}
static int parse_ns_string(const char *ptr) static int parse_ns_string(const char *ptr)
{ {
const char *end = ptr + strlen(ptr); const char *end = ptr + strlen(ptr);
@ -77,10 +87,7 @@ int main(int argc, char *argv[])
if (argc < 2) if (argc < 2)
goto usage; goto usage;
/* Default options */ init_opts();
opts.final_state = TASK_DEAD;
INIT_LIST_HEAD(&opts.veth_pairs);
INIT_LIST_HEAD(&opts.scripts);
if (init_service_fd()) if (init_service_fd())
return -1; return -1;

View File

@ -48,6 +48,8 @@ struct cr_options {
extern struct cr_options opts; extern struct cr_options opts;
extern void init_opts(void);
enum sfd_type { enum sfd_type {
SERVICE_FD_MIN, SERVICE_FD_MIN,