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 authored and Colin Walters committed 2012-04-18 15:20:46 -04:00
1 parent 99803babd9
commit 99142ef417
1 file changed
+2 -2
+2 -2
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);
}