Permalink
Browse files

Merge pull request #104 from roidayan/fix_flashcache_load

Fix flashcache_load getting cachedev from argv when using flags
  • Loading branch information...
2 parents ed198f8 + f99b7c4 commit 542a8ec29b9bf92ba66995ace185e43f31a1a699 @mohans mohans committed Feb 27, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/utils/flashcache_load.c
@@ -114,7 +114,7 @@ main(int argc, char **argv)
}
}
- if ((argc < 2) || (argc > 3)) {
+ if ((argc < 2) || (argc > 4)) {
usage(pname);
}
@@ -143,10 +143,10 @@ main(int argc, char **argv)
}
// switch to new vdev name if requested by load command
- if (argc == 3) {
- cachedev = argv[optind];
- } else {
+ if (optind == argc) {
cachedev = sb->cache_devname;
+ } else {
+ cachedev = argv[optind];
}
disk_devname = sb->disk_devname;

0 comments on commit 542a8ec

Please sign in to comment.