HomeClusterLabs Projects

Refactor: libcrmcommon, daemons: Use the new network-related return codes.

Description

Refactor: libcrmcommon, daemons: Use the new network-related return codes.

In the couple places we are calling getaddrinfo(), translate its return
code and then use pcmk_rc_str to get an error message just like for all
other errors.

This has two other effects:

  • get_address_info now returns a standard Pacemaker return code, which isn't really a huge change because its one caller only cares about success vs. failure.
  • pcmkconnect_remote can now return additional codes if getaddrinfo fails instead of just ENOTCONN. Note that the callers of pcmkconnect_remote could also use modification to consider these new return codes, but this seems like it's going to get out of control pretty quickly. Instead, each caller should probably be modified when it is audited for best practices.

Fixes T387

Details

Provenance
clumensAuthored on Jul 26 2023, 3:57 PM
Parents
rP051a083c7d09: Feature: libcrmcommon: Add pcmk__gaierror2rc.
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task