varlink: move definition of varlink_hash_ops into common code

This is truly useful whenever we have to deal with multiple varlink
connections.
This commit is contained in:
Lennart Poettering
2025-10-16 16:24:29 +02:00
parent 73740ca2fc
commit 78a135f567
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -203,3 +203,11 @@ int varlink_check_privileged_peer(sd_varlink *vl) {
return 0;
}
DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
varlink_hash_ops,
void,
trivial_hash_func,
trivial_compare_func,
sd_varlink,
sd_varlink_unref);
+2
View File
@@ -27,3 +27,5 @@ int varlink_server_new(
void *userdata);
int varlink_check_privileged_peer(sd_varlink *vl);
extern const struct hash_ops varlink_hash_ops;