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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user