summaryrefslogtreecommitdiff
path: root/src/shared/pwquality-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-06-22 08:48:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-06-24 10:16:43 +0200
commitfff25ab22eec825a15c2647a84247221abd6b0c8 (patch)
tree3814050fb6658bf84cdb3bec69a827bd6075def1 /src/shared/pwquality-util.c
parent87501ac0ebacf4df3a7eb1a066f5e359de2da4ba (diff)
downloadsystemd-fff25ab22eec825a15c2647a84247221abd6b0c8.tar.gz
dlfcn-util: invert function naming and add helper that does the whole job
We warn when the operation fails, not when it succeeds. Hence this should be "<do>_or_<handle failure>", not "<do>_and_<handle failure>". We *could* use whatever convention we want, but rust and perl are rather consistent in using the logical convention. We don't care about perl that much, but having a naming convention inverted wrt. rust would be rather confusing. Also, pretty much every implementation does similar steps, so add a nice wrapper which combines opening of the library and loading of the symbols. Also add missing sentinel attribute in dlopen_or_warn().
Diffstat (limited to 'src/shared/pwquality-util.c')
-rw-r--r--src/shared/pwquality-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/pwquality-util.c b/src/shared/pwquality-util.c
index 5bd33eee4c..d7776e7eff 100644
--- a/src/shared/pwquality-util.c
+++ b/src/shared/pwquality-util.c
@@ -35,7 +35,7 @@ int dlopen_pwquality(void) {
return log_debug_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
"libpwquality support is not installed: %s", dlerror());
- r = dlsym_many_and_warn(
+ r = dlsym_many_or_warn(
dl,
LOG_DEBUG,
DLSYM_ARG(pwquality_check),