From: Karel Zak Date: Thu, 17 Dec 2020 10:07:25 +0000 (+0100) Subject: libmount: fix compiler warnings [-Wmaybe-uninitialized] X-Git-Tag: v2.37-rc1~215 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22a64b02b9b953af4f30506cd3c10de4630de632;p=thirdparty%2Futil-linux.git libmount: fix compiler warnings [-Wmaybe-uninitialized] Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_loopdev.c b/libmount/src/context_loopdev.c index c5fc80d77f..6462bfb629 100644 --- a/libmount/src/context_loopdev.c +++ b/libmount/src/context_loopdev.c @@ -250,7 +250,7 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt) case 2: /* overlap -- full size and offset match (reuse) */ { - uint32_t lc_encrypt_type; + uint32_t lc_encrypt_type = 0; DBG(LOOP, ul_debugobj(cxt, "re-using existing loop device %s", loopcxt_get_device(&lc))); diff --git a/libmount/src/lock.c b/libmount/src/lock.c index cc5340db18..fac64b63b7 100644 --- a/libmount/src/lock.c +++ b/libmount/src/lock.c @@ -277,7 +277,7 @@ static void mnt_lockalrm_handler(int sig __attribute__((__unused__))) */ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t maxtime) { - struct timeval now; + struct timeval now = { 0 }; struct sigaction sa, osa; int ret = 0; @@ -394,8 +394,8 @@ static void unlock_mtab(struct libmnt_lock *ml) static int lock_mtab(struct libmnt_lock *ml) { int i, rc = -1; - struct timespec waittime; - struct timeval maxtime; + struct timespec waittime = { 0 };; + struct timeval maxtime = { 0 }; const char *lockfile, *linkfile; if (!ml) @@ -443,7 +443,7 @@ static int lock_mtab(struct libmnt_lock *ml) /* Repeat until it was us who made the link */ while (!ml->locked) { - struct timeval now; + struct timeval now = { 0 }; struct flock flock; int j;