From: Yu Watanabe Date: Mon, 10 Mar 2025 10:29:51 +0000 (+0900) Subject: event-util: move event_source_hash_ops to event-util X-Git-Tag: v258-rc1~1126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c24148451a91879e5a1b7a92364196f57bc59cb5;p=thirdparty%2Fsystemd.git event-util: move event_source_hash_ops to event-util --- diff --git a/src/libsystemd/sd-event/event-util.c b/src/libsystemd/sd-event/event-util.c index 9e0dbd30c3b..47cf76f9c2c 100644 --- a/src/libsystemd/sd-event/event-util.c +++ b/src/libsystemd/sd-event/event-util.c @@ -12,6 +12,13 @@ #define SI_FLAG_FORWARD (INT32_C(1) << 30) #define SI_FLAG_POSITIVE (INT32_C(1) << 29) +DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR( + event_source_hash_ops, + sd_event_source, + (void (*)(const sd_event_source*, struct siphash*)) trivial_hash_func, + (int (*)(const sd_event_source*, const sd_event_source*)) trivial_compare_func, + sd_event_source_disable_unref); + int event_reset_time( sd_event *e, sd_event_source **s, diff --git a/src/libsystemd/sd-event/event-util.h b/src/libsystemd/sd-event/event-util.h index 2c6fcccb908..3d5ee4d3310 100644 --- a/src/libsystemd/sd-event/event-util.h +++ b/src/libsystemd/sd-event/event-util.h @@ -5,8 +5,11 @@ #include "sd-event.h" +#include "hash-funcs.h" #include "pidref.h" +extern const struct hash_ops event_source_hash_ops; + int event_reset_time( sd_event *e, sd_event_source **s, diff --git a/src/mountfsd/mountfsd-manager.c b/src/mountfsd/mountfsd-manager.c index b05c6e8493b..215dcb5b2fa 100644 --- a/src/mountfsd/mountfsd-manager.c +++ b/src/mountfsd/mountfsd-manager.c @@ -6,6 +6,7 @@ #include "build-path.h" #include "common-signal.h" #include "env-util.h" +#include "event-util.h" #include "fd-util.h" #include "fs-util.h" #include "mkdir.h" @@ -58,13 +59,6 @@ static int on_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, voi return 0; } -DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR( - event_source_hash_ops, - sd_event_source, - (void (*)(const sd_event_source*, struct siphash*)) trivial_hash_func, - (int (*)(const sd_event_source*, const sd_event_source*)) trivial_compare_func, - sd_event_source_disable_unref); - int manager_new(Manager **ret) { _cleanup_(manager_freep) Manager *m = NULL; int r; diff --git a/src/nsresourced/nsresourced-manager.c b/src/nsresourced/nsresourced-manager.c index 152b506da52..7fac1828ca2 100644 --- a/src/nsresourced/nsresourced-manager.c +++ b/src/nsresourced/nsresourced-manager.c @@ -12,6 +12,7 @@ #include "build-path.h" #include "common-signal.h" #include "env-util.h" +#include "event-util.h" #include "fd-util.h" #include "fs-util.h" #include "mkdir.h" @@ -79,13 +80,6 @@ static int on_deferred_start_worker(sd_event_source *s, uint64_t usec, void *use return 0; } -DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR( - event_source_hash_ops, - sd_event_source, - (void (*)(const sd_event_source*, struct siphash*)) trivial_hash_func, - (int (*)(const sd_event_source*, const sd_event_source*)) trivial_compare_func, - sd_event_source_disable_unref); - int manager_new(Manager **ret) { _cleanup_(manager_freep) Manager *m = NULL; int r; diff --git a/src/userdb/userdbd-manager.c b/src/userdb/userdbd-manager.c index 5925602e433..3d3ac8fdc63 100644 --- a/src/userdb/userdbd-manager.c +++ b/src/userdb/userdbd-manager.c @@ -7,6 +7,7 @@ #include "build-path.h" #include "common-signal.h" #include "env-util.h" +#include "event-util.h" #include "fd-util.h" #include "fs-util.h" #include "mkdir.h" @@ -67,13 +68,6 @@ static int on_deferred_start_worker(sd_event_source *s, uint64_t usec, void *use return 0; } -DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR( - event_source_hash_ops, - sd_event_source, - (void (*)(const sd_event_source*, struct siphash*)) trivial_hash_func, - (int (*)(const sd_event_source*, const sd_event_source*)) trivial_compare_func, - sd_event_source_disable_unref); - int manager_new(Manager **ret) { _cleanup_(manager_freep) Manager *m = NULL; int r;