mirror of
https://github.com/ceph/ceph
synced 2025-01-11 05:29:51 +00:00
messages: avoid converting ceph errors on Windows
libclient and libcephfs return CEPHFS_E* errors, which are basically Linux errno codes. If we convert mds errors to host errno values, we end up mixing error codes. For Windows, we'll preserve the original error value, which is expected to be a Linux (CEPHFS_E*) error. It may be worth doing the same for other platforms eventually. Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
This commit is contained in:
parent
ad0094fa04
commit
c381c299e1
@ -326,7 +326,18 @@ public:
|
||||
epoch_t get_mdsmap_epoch() const { return head.mdsmap_epoch; }
|
||||
|
||||
int get_result() const {
|
||||
#ifdef _WIN32
|
||||
// libclient and libcephfs return CEPHFS_E* errors, which are basically
|
||||
// Linux errno codes. If we convert mds errors to host errno values, we
|
||||
// end up mixing error codes.
|
||||
//
|
||||
// For Windows, we'll preserve the original error value, which is expected
|
||||
// to be a linux (CEPHFS_E*) error. It may be worth doing the same for
|
||||
// other platforms.
|
||||
return head.result;
|
||||
#else
|
||||
return ceph_to_hostos_errno((__s32)(__u32)head.result);
|
||||
#endif
|
||||
}
|
||||
|
||||
void set_result(int r) { head.result = r; }
|
||||
|
Loading…
Reference in New Issue
Block a user