mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
Apps using libvirt will often have code like if (virXXXX() < 0) { virErrorPtr err = virGetLastError(); fprintf(stderr, "Something failed: %s\n", err && err->message ? err->message : "unknown error"); return -1; } Checking for a NULL error object or message leads to very verbose code. A virGetLastErrorMessage() helper from libvirt can simplify this to if (virXXXX() < 0) { fprintf(stderr, "Something failed: %s\n", virGetLastErrorMessage()); return -1; } Signed-off-by: Daniel P. Berrange <berrange@redhat.com> |
||
---|---|---|
.. | ||
libvirt | ||
Makefile.am |