summaryrefslogtreecommitdiff
path: root/btrfsctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-05-22 10:07:10 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-05-22 10:07:10 -0400
commit832427bdbad9c2e7ad9635ddc1cad05563d9d16a (patch)
tree0eed70223aed40c0e8459daa70e27d7394fac7ea /btrfsctl.c
parent723eafc64706679e8932b6cd2fb66005be4f7387 (diff)
cleanup warnings found with -O2
Diffstat (limited to 'btrfsctl.c')
-rw-r--r--btrfsctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/btrfsctl.c b/btrfsctl.c
index 01fd95aa..3710bc6a 100644
--- a/btrfsctl.c
+++ b/btrfsctl.c
@@ -33,11 +33,11 @@ int main(int ac, char **av)
int fd;
int ret;
struct btrfs_ioctl_vol_args args;
- char *name;
+ char *name = NULL;
int i;
struct stat st;
DIR *dirstream;
- unsigned long command;
+ unsigned long command = 0;
for (i = 1; i < ac - 1; i++) {
if (strcmp(av[i], "-s") == 0) {
@@ -65,6 +65,10 @@ int main(int ac, char **av)
command = BTRFS_IOC_ADD_DISK;
}
}
+ if (command == 0) {
+ fprintf(stderr, "no valid commands given\n");
+ exit(1);
+ }
fname = av[ac - 1];
printf("fname is %s\n", fname);
ret = stat(fname, &st);