aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-08-26 13:42:30 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-08-28 18:17:26 -0400
commitcbe1aa0bd88f076c4feec8662fb0cde8eeb3c6e8 (patch)
tree17d77370045cd36ec5cbc4a6538bb6883c970662
parent6304d212bea8368dcaeffc40ed120c2e89bae95a (diff)
downloade2fsprogs-cbe1aa0bd88f076c4feec8662fb0cde8eeb3c6e8.tar.gz
Silence valgrind warnings
Valgrind doesn't understand that the kernel will be initializing the struct termios and struct loop_info64 structures. Since they occur in functions which are not in the hot path, preinitialize to zero to prevent valgrind from producing a huge number of false positives. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--e2fsck/util.c2
-rw-r--r--lib/ext2fs/ismounted.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/e2fsck/util.c b/e2fsck/util.c
index 43cb7a745..a297e58f1 100644
--- a/e2fsck/util.c
+++ b/e2fsck/util.c
@@ -204,7 +204,7 @@ int ask_yn(e2fsck_t ctx, const char * string, int def)
static int yes_answers;
#ifdef HAVE_TERMIOS_H
- struct termios termios, tmp;
+ struct termios termios = {0, }, tmp;
tcgetattr (0, &termios);
tmp = termios;
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index 7d5247155..120299c4f 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -66,7 +66,7 @@ static int check_loop_mounted(const char *mnt_fsname, dev_t mnt_rdev,
dev_t file_dev, ino_t file_ino)
{
#if defined(HAVE_LINUX_LOOP_H) && defined(HAVE_LINUX_MAJOR_H)
- struct loop_info64 loopinfo;
+ struct loop_info64 loopinfo = {0, };
int loop_fd, ret;
if (major(mnt_rdev) == LOOP_MAJOR) {