Commit b025ef1d authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

criu: return an error if arguments contains more than one command

For example:
$ criu show stats-dump
Error (crtools.c:468): Unable to handle more than one command

$ ./criu show -f stats-dump
dump: {
	freezing_time: 626
	frozen_time: 24762
	memdump_time: 2696
	memwrite_time: 1007
	pages_scanned: 1108
	pages_skipped_parent: 0
	pages_written: 28
	irmap_resolve: 0
}
Reported-by: 's avatarThouraya TH <thouraya87@gmail.com>
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 63cb8b4d
......@@ -463,6 +463,9 @@ int main(int argc, char *argv[], char *envp[])
opts.exec_cmd = xmalloc((argc - optind) * sizeof(char *));
memcpy(opts.exec_cmd, &argv[optind + 1], (argc - optind - 1) * sizeof(char *));
opts.exec_cmd[argc - optind - 1] = NULL;
} else if (optind + 1 != argc) {
pr_err("Unable to handle more than one command\n");
goto usage;
}
/* We must not open imgs dir, if service is called */
......
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