提交 9cd40549 编写于 作者: R Richard W.M. Jones

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.
上级 483f6d69
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
......
......@@ -883,8 +883,10 @@ __virConfWriteFile(const char *filename, virConfPtr conf)
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) {
......@@ -935,8 +937,10 @@ __virConfWriteMem(char *memory, int *len, virConfPtr conf)
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) {
......
......@@ -10,7 +10,7 @@
* archive for more details.
*/
#define _GNU_SOURCE
#define _GNU_SOURCE /* for strndup */
#include "sexpr.h"
#include "internal.h"
......
......@@ -1389,6 +1389,7 @@ char * testDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED)
con = &node->connections[priv->handle];
if (!(buf = virBufferNew(4000))) {
testError(domain->conn, domain, VIR_ERR_NO_MEMORY, __FUNCTION__);
return (NULL);
}
......
......@@ -13,8 +13,6 @@
* $Id$
*/
#define _GNU_SOURCE /* isblank() */
#include "libvirt/libvirt.h"
#include "libvirt/virterror.h"
#include <stdio.h>
......@@ -3806,7 +3804,7 @@ vshCommandGetToken(vshControl * ctl, char *str, char **end, char **res)
*end = NULL;
while (p && *p && isblank((unsigned char) *p))
while (p && *p && (*p == ' ' || *p == '\t'))
p++;
if (p == NULL || *p == '\0')
......@@ -3817,7 +3815,7 @@ vshCommandGetToken(vshControl * ctl, char *str, char **end, char **res)
}
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 '=' */
......
......@@ -2138,7 +2138,10 @@ xenHypervisorMakeCapabilitiesXML(virConnectPtr conn ATTRIBUTE_UNUSED,
/* 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\
......@@ -2225,15 +2228,13 @@ xenHypervisorMakeCapabilitiesXML(virConnectPtr conn ATTRIBUTE_UNUSED,
</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;
}
......
......@@ -267,10 +267,7 @@ virXPathNodeSet(const char *xpath, xmlXPathContextPtr ctxt, xmlNodePtr **list) {
xmlXPathFreeObject(obj);
return(ret);
}
#endif /* !PROXY */
#ifndef PROXY
/**
* virtDomainParseXMLGraphicsDescImage:
* @conn: pointer to the hypervisor connection
......
......@@ -46,8 +46,8 @@ valgrind:
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册