mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
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:
@@ -130,8 +130,6 @@ static const char* const transfer_type_table[_TRANSFER_TYPE_MAX] = {
|
||||
|
||||
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(transfer_type, TransferType);
|
||||
|
||||
DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(varlink_hash_ops, void, trivial_hash_func, trivial_compare_func, sd_varlink, sd_varlink_unref);
|
||||
|
||||
static Transfer *transfer_unref(Transfer *t) {
|
||||
if (!t)
|
||||
return NULL;
|
||||
|
||||
@@ -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