common,filestore: silence GCC-8 warnings

should catch polymorphic exceptions by reference. this silences warnings
like:

error: catching polymorphic type ‘class std::RetryException’ by value
[-Werror=catch-value=]
     } catch (std::RetryException) {

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2018-05-06 14:39:18 +08:00
parent 19230378c8
commit 62382040ee
3 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ cmd_getval(CephContext *cct, const cmdmap_t& cmdmap, const std::string& k, T& va
try {
val = boost::get<T>(cmdmap.find(k)->second);
return true;
} catch (boost::bad_get) {
} catch (boost::bad_get&) {
handle_bad_get(cct, k, typeid(T).name());
}
}

View File

@ -130,7 +130,7 @@ class DaemonState
auto p = config_defaults_bl.begin();
try {
decode(config_defaults, p);
} catch (buffer::error e) {
} catch (buffer::error& e) {
}
}
return config_defaults;

View File

@ -63,7 +63,7 @@
out: \
complete_inject_failure(); \
return r; \
} catch (RetryException) { \
} catch (RetryException&) { \
failed = true; \
} catch (...) { \
ceph_abort(); \