HomeClusterLabs Projects

Refactor: libstonithd: Drop fstatat() from stonith__list_rhcs_agents()
74e3ff8b6691Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Refactor: libstonithd: Drop fstatat() from stonith__list_rhcs_agents()

This simplifies the function quite a bit. The fstatat() code was added
by 2a4d800 but it's unrelated to whatever that commit was trying to fix.
openat(), fstatat(), etc., are best practices on Linux but are not
portable, hence the ugly preprocessor guards.

The two main reasons to use the at() variants are to avoid directory
path race conditions and for thread safety. Neither of these is relevant
here. Pacemaker is single-threaded, and we shouldn't have to worry about
PCMK__FENCE_BINDIR being renamed or converted to a symlink while we're
in this function.

More details:
https://stackoverflow.com/a/35498833 (also includes man page quotes)

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

Details

Provenance
nrwahl2Authored on Feb 28 2025, 6:52 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.