mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 11:04:35 +00:00
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: Thouraya TH <thouraya87@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
63cb8b4da8
commit
b025ef1dbc
1 changed files with 3 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue