Skip to content

Commit 6c7b0dd

Browse files
committed
os: resolve unused variable warning
Found by Windows tests: [305/1061] /home/ubuntu/ceph/build.deps/mingw-llvm/bin/x86_64-w64-mingw32-clang++ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DBOOST_ASIO_NO_TS_EXECUTORS -DFMT_HEADER_ONLY=1 -DFMT_USE_TZSET=0 -DHAVE_CONFIG_H -DWITH_KSTORE -D_FILE_OFFSET_BITS=64 -D_POSIX=1 -D_POSIX_=1 -D_POSIX_C_SOURCE=1 -D_POSIX_THREADS=1 -D_REENTRANT -D_THREAD_SAFE -D_WIN32_WINNT=0x0A00 -D__CEPH__ -D__STDC_FORMAT_MACROS -I/home/ubuntu/ceph/build/src/include -I/home/ubuntu/ceph/src -I/home/ubuntu/ceph/src/include/win32 -isystem /home/ubuntu/ceph/build.deps/mingw/boost/include -isystem /home/ubuntu/ceph/build/include -isystem /home/ubuntu/ceph/src/xxHash -isystem /home/ubuntu/ceph/src/fmt/include -isystem /home/ubuntu/ceph/src/rocksdb/include -isystem /home/ubuntu/ceph/build.deps/mingw/snappy/include -isystem /home/ubuntu/ceph/build.deps/mingw/lz4/lib -isystem /home/ubuntu/ceph/build.deps/mingw/zlib/include -g1 -O3 -DNDEBUG -I/home/ubuntu/ceph/build.deps/mingw-llvm/x86_64-w64-mingw32/include -I/home/ubuntu/ceph/build.deps/mingw-llvm/x86_64-w64-mingw32/include -march=native -Wno-unknown-attributes -include winsock_wrapper.h -include win32_errno.h -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -Wsign-compare -ftemplate-depth-1024 -DBOOST_ALLOW_DEPRECATED_HEADERS -Wpessimizing-move -Wredundant-move -Wno-inconsistent-missing-override -Wno-mismatched-tags -Wno-unused-private-field -Wno-address-of-packed-member -Wno-unused-function -Wno-unused-local-typedef -Wno-varargs -Wno-gnu-designator -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register -fdiagnostics-color=auto -std=c++2b -MD -MT src/os/CMakeFiles/os.dir/ObjectStore.cc.obj -MF src/os/CMakeFiles/os.dir/ObjectStore.cc.obj.d -o src/os/CMakeFiles/os.dir/ObjectStore.cc.obj -c /home/ubuntu/ceph/src/os/ObjectStore.cc /home/ubuntu/ceph/src/os/ObjectStore.cc:72:7: warning: unused variable 'r' [-Wunused-variable] int r; ^ 1 warning generated. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 403f5d6 commit 6c7b0dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/os/ObjectStore.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ int ObjectStore::probe_block_device_fsid(
6969
const string& path,
7070
uuid_d *fsid)
7171
{
72-
int r;
73-
7472
#if defined(WITH_BLUESTORE)
7573
// first try bluestore -- it has a crc on its header and will fail
7674
// reliably.
77-
r = BlueStore::get_block_device_fsid(cct, path, fsid);
75+
int r = BlueStore::get_block_device_fsid(cct, path, fsid);
7876
if (r == 0) {
7977
lgeneric_dout(cct, 0) << __func__ << " " << path << " is bluestore, "
8078
<< *fsid << dendl;
8179
return r;
80+
} else {
81+
return -EINVAL;
8282
}
83-
#endif
84-
83+
#else
8584
return -EINVAL;
85+
#endif
8686
}
8787

8888
int ObjectStore::write_meta(const std::string& key,

0 commit comments

Comments
 (0)