Verified Commit 0370b97a authored by ANA MANZANO RODRIGUEZ's avatar ANA MANZANO RODRIGUEZ Committed by Alberto Miranda
Browse files

Update code to new error_code semantics

parent f47ac5b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ register_adhoc_storage(const server& srv, const std::string& name,
    return rv.value();
}

ADM_return_t
admire::error_code
update_adhoc_storage(const server& srv,
                     const adhoc_storage::ctx& adhoc_storage_ctx,
                     const adhoc_storage& adhoc_storage) {
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ register_adhoc_storage(const server& srv, const std::string& name,
                       enum adhoc_storage::type type,
                       const adhoc_storage::ctx& ctx);

ADM_return_t
admire::error_code
update_adhoc_storage(const server& srv,
                     const adhoc_storage::ctx& adhoc_storage_ctx,
                     const adhoc_storage& adhoc_storage);
+6 −7
Original line number Diff line number Diff line
@@ -431,21 +431,20 @@ update_adhoc_storage(const server& srv,

    const auto rpc = endp.call("ADM_update_adhoc_storage", &in, &out);

    if(out.retval < 0) {
        const auto retval = static_cast<admire::error_code>(out.retval);
    if(const auto rv = admire::error_code{out.retval}; !rv) {
        LOGGER_ERROR("rpc id: {} name: {} from: {} <= "
                     "body: {{retval: {}}} [op_id: {}]",
                     rpc_id, std::quoted("ADM_"s + __FUNCTION__), retval,
                     rpc_id, std::quoted("ADM_"s + __FUNCTION__), rv,
                     out.op_id);
        return retval;
        return rv;
    }

    LOGGER_INFO("rpc id: {} name: {} from: {} <= "
                "body: {{retval: {}}} [op_id: {}]",
                rpc_id, std::quoted("ADM_"s + __FUNCTION__), ADM_SUCCESS,
                out.op_id);
                rpc_id, std::quoted("ADM_"s + __FUNCTION__),
                admire::error_code::success, out.op_id);

    return ADM_SUCCESS;
    return admire::error_code::success;
}

} // namespace admire::detail
+3 −3
Original line number Diff line number Diff line
@@ -344,15 +344,15 @@ ADM_update_adhoc_storage(hg_handle_t h) {
                rpc_id, std::quoted(__FUNCTION__), std::quoted(get_address(h)),
                in.adhoc_storage->s_id);

    admire::error_code rv = ADM_SUCCESS;
    admire::error_code ec;

    out.op_id = rpc_id;
    out.retval = rv;
    out.retval = ec;

    LOGGER_INFO("rpc id: {} name: {} to: {} => "
                "body: {{retval: {}, server_id: {}}}",
                rpc_id, std::quoted(__FUNCTION__), std::quoted(get_address(h)),
                rv, out.server_id);
                ec, out.server_id);

    ret = margo_respond(h, &out);
    assert(ret == HG_SUCCESS);