]> xenbits.xensource.com Git - libvirt.git/commitdiff
closeCallback is already lockable, initialize it as such
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 7 Apr 2015 15:18:01 +0000 (17:18 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 15 Apr 2015 11:33:35 +0000 (13:33 +0200)
Luckily we are allocating structs as clean memory and
PTHREAD_MUTEX_INITIALIZER is "{ 0 }", so nothing happened, but it should
still be created as lockable object.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/datatypes.c

index 0f535b44efda89ec9e758e7ff7aba4457f279169..dc024f8398dd913c5f9603b12ba5415fb4d419c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * datatypes.c: management of structs for public data types
  *
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -113,7 +113,7 @@ virGetConnect(void)
     if (!(ret = virObjectNew(virConnectClass)))
         return NULL;
 
-    if (!(ret->closeCallback = virObjectNew(virConnectCloseCallbackDataClass)))
+    if (!(ret->closeCallback = virObjectLockableNew(virConnectCloseCallbackDataClass)))
         goto error;
 
     if (virMutexInit(&ret->lock) < 0)