On Mon, Jul 21, 2014 at 06:13:36PM +0800, Jincheng Miao wrote:
Implement vir{Mutex,RWLock,Cond}InitInternal functions which have
related error report when failure, and vir{Mutex,RWLock,Cond}Init
as macros. So that the caller no longer to print error message
explicitly.
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/libvirt_private.syms | 7 +++---
src/util/virthread.c | 56 +++++++++++++++++++++---------------------------
src/util/virthread.h | 25 +++++++++++++++++----
3 files changed, 49 insertions(+), 39 deletions(-)
+#define VIR_THREAD_ERR_EXIT(str) do {
\
+ errno = ret; \
+ virReportSystemErrorFull(VIR_FROM_NONE, errno, \
+ filename, funcname, linenr, \
+ "%s", _(str)); \
+ return -1; \
+ } while (0)
Using '_(...)' here isn't going to work for translations because
xgettext won't find the strings.
-}
+ if (ret != 0)
+ VIR_THREAD_ERR_EXIT("unable to init Mutex");
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|