From 99142ef417f4af82095fba95d02ad73cfd80a2c9 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Wed, 18 Apr 2012 21:13:43 +0300 Subject: [PATCH] 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 --- src/switchroot/ostree-switch-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switchroot/ostree-switch-root.c b/src/switchroot/ostree-switch-root.c index 60306e6c..c96ed3b4 100644 --- a/src/switchroot/ostree-switch-root.c +++ b/src/switchroot/ostree-switch-root.c @@ -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); }