diff options
author | José Bollo <jose.bollo@iot.bzh> | 2019-04-09 11:49:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@automotivelinux.org> | 2019-04-09 11:49:59 +0000 |
commit | 1a75612274f883aed09d198575582abdc0c9fe0f (patch) | |
tree | 9e94b8c4ac76eee6c27d31b6122f778e7d818f85 /plugins/alsa/alsa-transaction.c | |
parent | 3786d73cd834672592089882de40d4fe3fb0510f (diff) | |
parent | 7687aea64ee6505818a563b6aa42303ab9be2e78 (diff) |
Merge "Updates for latest libavirt, adds avirt cleanup"
Diffstat (limited to 'plugins/alsa/alsa-transaction.c')
-rw-r--r-- | plugins/alsa/alsa-transaction.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/alsa/alsa-transaction.c b/plugins/alsa/alsa-transaction.c index c35ea81..f8affa6 100644 --- a/plugins/alsa/alsa-transaction.c +++ b/plugins/alsa/alsa-transaction.c @@ -71,6 +71,27 @@ fail: } +bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor) { + bool ret = false; + AlsaMixerTransactionDataItem * newItem = NULL; + if (!list) + goto fail; + + newItem = (AlsaMixerTransactionDataItem *) malloc(sizeof(AlsaMixerTransactionDataItem)); + if (newItem == NULL) + goto fail; + + CDS_INIT_LIST_HEAD(&newItem->list_entry); + newItem->object = object; + newItem->destructor = destructor; + cds_list_add_tail(&newItem->list_entry, &list->item_list); + + ret = true; +fail: + return ret; + +} + static void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction* transaction) { AlsaMixerTransactionDataItem * item, *sav; |