diff --git a/include/ylt/coro_io/ibverbs/ib_device.hpp b/include/ylt/coro_io/ibverbs/ib_device.hpp index f91c9a64f..0d851932b 100644 --- a/include/ylt/coro_io/ibverbs/ib_device.hpp +++ b/include/ylt/coro_io/ibverbs/ib_device.hpp @@ -279,7 +279,7 @@ class ib_device_t : public std::enable_shared_from_this { if (gid_index_ >= 0) { if (auto ec = ibv_query_gid(ctx_.get(), conf.port, gid_index_, &gid_); ec) { - auto err_code = std::make_error_code(std::errc{ec}); + auto err_code = std::make_error_code(std::errc{errno}); ELOG_ERROR << "IBDevice failed to query port " << conf.port << " of device " << name_ << " by gid_index:" << gid_index_ << ", error msg: " << err_code.message(); diff --git a/include/ylt/coro_io/ibverbs/ib_socket.hpp b/include/ylt/coro_io/ibverbs/ib_socket.hpp index 41b97d45a..96bec8329 100644 --- a/include/ylt/coro_io/ibverbs/ib_socket.hpp +++ b/include/ylt/coro_io/ibverbs/ib_socket.hpp @@ -996,7 +996,7 @@ class ib_socket_t { int flags = IBV_QP_STATE | IBV_QP_PKEY_INDEX | IBV_QP_PORT | IBV_QP_ACCESS_FLAGS; if (auto ec = ibv_modify_qp(state_->qp_.get(), &attr, flags); ec) { - auto err_code = std::make_error_code(std::errc{ec}); + auto err_code = std::make_error_code(std::errc{errno}); ELOG_ERROR << "modify qp to init failed: " << err_code.message() << ", QP=" << state_->qp_->qp_num; throw std::system_error(err_code); @@ -1029,7 +1029,7 @@ class ib_socket_t { IBV_QP_RQ_PSN | IBV_QP_MAX_DEST_RD_ATOMIC | IBV_QP_MIN_RNR_TIMER; if (auto ec = ibv_modify_qp(state_->qp_.get(), &attr, flags); ec) { - auto err_code = std::make_error_code(std::errc{ec}); + auto err_code = std::make_error_code(std::errc{errno}); ELOG_ERROR << "modify qp to rtr failed: " << err_code.message() << ", QP=" << state_->qp_->qp_num; throw std::system_error(err_code); @@ -1047,7 +1047,7 @@ class ib_socket_t { int flags = IBV_QP_STATE | IBV_QP_TIMEOUT | IBV_QP_RETRY_CNT | IBV_QP_RNR_RETRY | IBV_QP_SQ_PSN | IBV_QP_MAX_QP_RD_ATOMIC; if (auto ec = ibv_modify_qp(state_->qp_.get(), &attr, flags); ec != 0) { - auto err_code = std::make_error_code(std::errc{ec}); + auto err_code = std::make_error_code(std::errc{errno}); ELOG_ERROR << "modify qp to rts failed: " << err_code.message() << ", QP=" << state_->qp_->qp_num; throw std::system_error(err_code);