Signed-off-by: Rafael Fonseca <r4f4rfs(a)gmail.com>
---
src/secret/secret_driver.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 1cb342878f..51a8a6e53e 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -54,7 +54,7 @@ enum { SECRET_MAX_XML_FILE = 10*1024*1024 };
typedef struct _virSecretDriverState virSecretDriverState;
typedef virSecretDriverState *virSecretDriverStatePtr;
struct _virSecretDriverState {
- virMutex lock;
+ GMutex lock;
bool privileged; /* readonly */
char *embeddedRoot; /* readonly */
int embeddedRefs;
@@ -74,14 +74,14 @@ static virSecretDriverStatePtr driver;
static void
secretDriverLock(void)
{
- virMutexLock(&driver->lock);
+ g_mutex_lock(&driver->lock);
}
static void
secretDriverUnlock(void)
{
- virMutexUnlock(&driver->lock);
+ g_mutex_unlock(&driver->lock);
}
@@ -446,7 +446,7 @@ secretStateCleanup(void)
VIR_FREE(driver->stateDir);
secretDriverUnlock();
- virMutexDestroy(&driver->lock);
+ g_mutex_clear(&driver->lock);
VIR_FREE(driver);
return 0;
@@ -463,10 +463,7 @@ secretStateInitialize(bool privileged,
return VIR_DRV_STATE_INIT_ERROR;
driver->lockFD = -1;
- if (virMutexInit(&driver->lock) < 0) {
- VIR_FREE(driver);
- return VIR_DRV_STATE_INIT_ERROR;
- }
+ g_mutex_init(&driver->lock);
secretDriverLock();
driver->secretEventState = virObjectEventStateNew();
--
2.25.2