HomeClusterLabs Projects

Refactor: various: Check pcmk__xe_get_time() rc only where useful

Description

Refactor: various: Check pcmk__xe_get_time() rc only where useful

Take advantage of the fact that the destination output variable is
unchanged on error. If the caller initialized it to some value (either
explicitly or by allocating memory with calloc() or
pcmk__assert_alloc()), then we can assume that either it's unchanged or
a valid value was parsed into it.

The lrmd_dispatch_internal() case is a little bit different. We weren't
checking the return value. epoch would've been unchanged from
PCMKXA_LRMD_RUN_TIME if PCMKXA_LRMD_RCCHANGE_TIME were unset. But it
won't be unset (see send_cmd_complete_notify()), so this is irrelevant,
and the epoch variable is unnecessary.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 19 2025, 2:44 AM
Parents
rPa5fd25aaf55b: Refactor: libpe_status: Fix whitespace issues in pe_actions.c
Branches
Unknown
Tags
Unknown