+Wed Jul 4 10:14:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
+
+ * src/conf.c, src/test.c, src/xen_internal.c: Readd checking
+ of errors from virBuffer functions.
+ * src/sexpr.c: Add comment about use of _GNU_SOURCE.
+ * src/virsh.c: Remove use of _GNU_SOURCE / isblank.
+ * src/xml.c, tests/Makefile.am: Minor cleanup.
+
Mon Jul 2 09:35:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_driver.c: Change 'qemu' to 'QEMU' to get compatability
return(-1);
buf = virBufferNew(500);
- if (buf == NULL)
+ if (buf == NULL) {
+ virConfError(NULL, VIR_ERR_NO_MEMORY, _("failed to allocate buffer"), 0);
return(-1);
+ }
cur = conf->entries;
while (cur != NULL) {
return(-1);
buf = virBufferNew(500);
- if (buf == NULL)
+ if (buf == NULL) {
+ virConfError(NULL, VIR_ERR_NO_MEMORY, _("failed to allocate buffer"), 0);
return(-1);
+ }
cur = conf->entries;
while (cur != NULL) {
* archive for more details.
*/
-#define _GNU_SOURCE
+#define _GNU_SOURCE /* for strndup */
#include "sexpr.h"
#include "internal.h"
con = &node->connections[priv->handle];
if (!(buf = virBufferNew(4000))) {
+ testError(domain->conn, domain, VIR_ERR_NO_MEMORY, __FUNCTION__);
return (NULL);
}
* $Id$
*/
-#define _GNU_SOURCE /* isblank() */
-
#include "libvirt/libvirt.h"
#include "libvirt/virterror.h"
#include <stdio.h>
*end = NULL;
- while (p && *p && isblank((unsigned char) *p))
+ while (p && *p && (*p == ' ' || *p == '\t'))
p++;
if (p == NULL || *p == '\0')
}
while (*p) {
/* end of token is blank space or ';' */
- if ((quote == FALSE && isblank((unsigned char) *p)) || *p == ';')
+ if ((quote == FALSE && (*p == ' ' || *p == '\t')) || *p == ';')
break;
/* end of option name could be '=' */
/* Construct the final XML. */
xml = virBufferNew (1024);
- if (!xml) return NULL;
+ if (!xml) {
+ virXenError(VIR_ERR_NO_MEMORY, __FUNCTION__, 0);
+ return NULL;
+ }
r = virBufferVSprintf (xml,
"\
<capabilities>\n\
</capabilities>\n", -1);
if (r == -1) goto vir_buffer_failed;
xml_str = strdup (xml->content);
- if (!xml_str) {
- virXenError(VIR_ERR_NO_MEMORY, "strdup", 0);
- goto vir_buffer_failed;
- }
+ if (!xml_str) goto vir_buffer_failed;
virBufferFree (xml);
return xml_str;
vir_buffer_failed:
+ virXenError(VIR_ERR_NO_MEMORY, __FUNCTION__, 0);
virBufferFree (xml);
return NULL;
}
xmlXPathFreeObject(obj);
return(ret);
}
-#endif /* !PROXY */
-
-#ifndef PROXY
/**
* virtDomainParseXMLGraphicsDescImage:
* @conn: pointer to the hypervisor connection
xmlrpctest_SOURCES = \
xmlrpctest.c \
testutils.c testutils.h \
- $(top_builddir)/src/xmlrpc.c \
- $(top_builddir)/src/xmlrpc.h
+ @top_srcdir@/src/xmlrpc.c \
+ @top_srcdir@/src/xmlrpc.h
xmlrpctest_LDFLAGS =
xmlrpctest_LDADD = $(LDADDS)