2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 07:45:17 +00:00

The pid == 0 is enough.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2011-12-28 20:39:00 +04:00
committed by Cyrill Gorcunov
parent d4fd91046f
commit 329d8aa662

View File

@@ -250,12 +250,11 @@ int get_image_path(char *path, int size, const char *fmt, int pid)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
pid_t pid; pid_t pid = 0;
int ret = -1; int ret = -1;
int opt, idx; int opt, idx;
int action = -1; int action = -1;
int log_inited = 0; int log_inited = 0;
bool has_pid = false;
static const char short_opts[] = "drsf:p:t:hcD:o:"; static const char short_opts[] = "drsf:p:t:hcD:o:";
static const struct option long_opts[] = { static const struct option long_opts[] = {
@@ -281,13 +280,10 @@ int main(int argc, char *argv[])
case 'p': case 'p':
pid = atoi(optarg); pid = atoi(optarg);
opts.leader_only = true; opts.leader_only = true;
has_pid = true;
break; break;
case 't': case 't':
pid = atoi(optarg); pid = atoi(optarg);
opts.leader_only = false; opts.leader_only = false;
has_pid = true;
break;
break; break;
case 'd': case 'd':
action = opt; action = opt;
@@ -333,10 +329,8 @@ int main(int argc, char *argv[])
return -1; return -1;
} }
if (!has_pid) { if (!pid && (action != 's' || !opts.show_dump_file))
if (action != 's' || !opts.show_dump_file) goto opt_pid_missing;
goto opt_pid_missing;
}
switch (action) { switch (action) {
case 'd': case 'd':