switchroot: Properly check for number of arguments

The ostree-switch-root tool expects three arguments (argc=4): new root, OS
tree target, and init(8) binary to launch inside it. Also, the error message
when not enough arguments are passed now tells about the second argument
being the target OS tree.

Reviewed-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Adrian Perez 2012-04-18 21:13:43 +03:00 committed by Colin Walters
parent 99803babd9
commit 99142ef417

View File

@ -168,9 +168,9 @@ main(int argc, char *argv[])
int before_init_argc = 0;
pid_t cleanup_pid;
if (argc < 3)
if (argc < 4)
{
fprintf (stderr, "usage: ostree-switch-root NEWROOT INIT [ARGS...]\n");
fprintf (stderr, "usage: ostree-switch-root NEWROOT TARGET INIT [ARGS...]\n");
exit (1);
}