From e08911913425c53f93a8a44820eaf42eb25193cd Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 5 Oct 2017 12:17:33 -0400 Subject: [PATCH] build: Fix a couple uninitialized variable warnings For GCC7. Signed-off-by: Adam C. Emerson --- src/cls/journal/cls_journal.cc | 2 +- src/tools/rbd/action/Import.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cls/journal/cls_journal.cc b/src/cls/journal/cls_journal.cc index f966c07f24a..7cc2866586a 100644 --- a/src/cls/journal/cls_journal.cc +++ b/src/cls/journal/cls_journal.cc @@ -404,7 +404,7 @@ int journal_get_splay_width(cls_method_context_t hctx, bufferlist *in, */ int journal_get_pool_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) { - int64_t pool_id; + int64_t pool_id = 0; int r = read_key(hctx, HEADER_KEY_POOL_ID, &pool_id); if (r < 0) { return r; diff --git a/src/tools/rbd/action/Import.cc b/src/tools/rbd/action/Import.cc index 3c717855270..1f95c246271 100644 --- a/src/tools/rbd/action/Import.cc +++ b/src/tools/rbd/action/Import.cc @@ -580,7 +580,7 @@ static int do_import_header(int fd, int import_format, uint64_t &size, librbd::I while (r == 0) { __u8 tag; - uint64_t length; + uint64_t length = 0; r = read_tag(fd, RBD_EXPORT_IMAGE_END, image_format, &tag, &length); if (r < 0 || tag == RBD_EXPORT_IMAGE_END) { break; -- 2.39.5