aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-find-root.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-02-20 09:30:50 +0800
committerChris Mason <clm@fb.com>2014-03-21 06:23:19 -0700
commitaab2f48c189bb89b71851edbb57e9074405a6262 (patch)
treec192a7100e3de7d70f638551bbf5db30d900c164 /btrfs-find-root.c
parent42a3d9b7746e5a3bab0ca4532069078c43083b2c (diff)
downloadbtrfs-progs-aab2f48c189bb89b71851edbb57e9074405a6262.tar.gz
btrfs-progs-aab2f48c189bb89b71851edbb57e9074405a6262.tar.xz
btrfs-progs-aab2f48c189bb89b71851edbb57e9074405a6262.zip
Btrfs-progs: switch to arg_strtou64() part1
switch to arg_strtou64 plus some cleanups to remove unnecessary codes. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'btrfs-find-root.c')
-rw-r--r--btrfs-find-root.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 0ba4c57..db01923 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -289,30 +289,13 @@ int main(int argc, char **argv)
switch(opt) {
errno = 0;
case 'o':
- search_objectid = (u64)strtoll(optarg, NULL,
- 10);
- if (errno) {
- fprintf(stderr, "Error parsing "
- "objectid\n");
- exit(1);
- }
+ search_objectid = arg_strtou64(optarg);
break;
case 'g':
- search_generation = (u64)strtoll(optarg, NULL,
- 10);
- if (errno) {
- fprintf(stderr, "Error parsing "
- "generation\n");
- exit(1);
- }
+ search_generation = arg_strtou64(optarg);
break;
case 'l':
- search_level = strtol(optarg, NULL, 10);
- if (errno) {
- fprintf(stderr, "Error parsing "
- "level\n");
- exit(1);
- }
+ search_level = arg_strtou64(optarg);
break;
default:
usage();