aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-debug-tree.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2014-07-16 11:59:46 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 15:07:02 +0200
commitf1672e50c7f73cbdb1d9817e126c41a3db6d93ce (patch)
tree98fe7252df2c382e7df70fb8a223c075416e0bbf /btrfs-debug-tree.c
parent2e1accf4fd47e90584b1741ff53bf7eec41d5510 (diff)
downloadbtrfs-progs-f1672e50c7f73cbdb1d9817e126c41a3db6d93ce.tar.gz
btrfs-progs-f1672e50c7f73cbdb1d9817e126c41a3db6d93ce.tar.xz
btrfs-progs-f1672e50c7f73cbdb1d9817e126c41a3db6d93ce.zip
btrfs-progs: use check_argc_* to check arg number for all tools
Since this patch: btrfs-progs: move the check_argc_* functions into utils.c All tools including the independent tools(e.g. btrfs-image, btrfs-convert) can share the convenience of the check_argc_* functions, so this patch adopt the argc check functions globally. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'btrfs-debug-tree.c')
-rw-r--r--btrfs-debug-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index 36e1115..e46500d 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
@@ -174,8 +174,9 @@ int main(int ac, char **av)
print_usage();
}
}
+ set_argv0(av);
ac = ac - optind;
- if (ac != 1)
+ if (check_argc_exact(ac, 1))
print_usage();
info = open_ctree_fs_info(av[optind], 0, 0, OPEN_CTREE_PARTIAL);