From: Danny Al-Gaaf Date: Mon, 14 May 2018 20:54:14 +0000 (+0200) Subject: common/buffer.cc: reduce scope of variables X-Git-Tag: v14.0.1~984^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=530d374d6ab616e5e3d887f14ecc39e8173b04cb;p=ceph.git common/buffer.cc: reduce scope of variables Signed-off-by: Danny Al-Gaaf --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 3d01a460af2f..b9da5bf9c14e 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2258,8 +2258,8 @@ int buffer::list::write_file(const char *fn, int mode) static int do_writev(int fd, struct iovec *vec, uint64_t offset, unsigned veclen, unsigned bytes) { - ssize_t r = 0; while (bytes > 0) { + ssize_t r = 0; #ifdef HAVE_PWRITEV r = ::pwritev(fd, vec, veclen, offset); #else @@ -2492,9 +2492,8 @@ void buffer::list::hexdump(std::ostream &out, bool trailing_newline) const unsigned per = 16; bool was_zeros = false, did_star = false; for (unsigned o=0; o