summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--btrfs-vol.c4
-rw-r--r--mkfs.c2
-rw-r--r--utils.c5
4 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 7100852e..287ce5ab 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
CC=gcc
AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
-CFLAGS = -g -Werror
+CFLAGS = -g -Werror -Os
objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
root-tree.o dir-item.o hash.o file-item.o inode-item.o \
inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o \
diff --git a/btrfs-vol.c b/btrfs-vol.c
index 0cc2e979..9eddd782 100644
--- a/btrfs-vol.c
+++ b/btrfs-vol.c
@@ -71,9 +71,9 @@ int main(int ac, char **av)
char *mnt = NULL;
int ret;
int option_index = 0;
- int cmd;
+ int cmd = 0;
int fd;
- int devfd;
+ int devfd = 0;
DIR *dirstream;
struct btrfs_ioctl_vol_args args;
u64 dev_block_count = 0;
diff --git a/mkfs.c b/mkfs.c
index c02627f3..740cc81d 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -308,7 +308,7 @@ int main(int ac, char **av)
u64 block_count = 0;
u64 dev_block_count = 0;
u64 blocks[6];
- u64 alloc_start;
+ u64 alloc_start = 0;
u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
u32 leafsize = getpagesize();
diff --git a/utils.c b/utils.c
index 2fa3c96c..44a5dc6d 100644
--- a/utils.c
+++ b/utils.c
@@ -645,7 +645,7 @@ int btrfs_register_one_device(char *fname)
int btrfs_scan_one_dir(char *dirname, int run_ioctl)
{
- DIR *dirp;
+ DIR *dirp = NULL;
struct dirent *dirent;
struct pending_dir *pending;
struct stat st;
@@ -734,7 +734,8 @@ again:
ret = 0;
fail:
free(pending);
- closedir(dirp);
+ if (dirp)
+ closedir(dirp);
return ret;
}