Print this page
2249 libbrand suppresses libxml2 errors
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Eric Shrock <eric.schrock@delphix.com>
Reviewed by: Milan Jurik <milan.jurik@xylab.cz>
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <assert.h>
#include <dirent.h>
#include <errno.h>
*** 100,116 ****
static char i_curr_arch[MAXNAMELEN];
static char i_curr_zone[ZONENAME_MAX];
/*ARGSUSED*/
static void
! brand_error_func(void *ctx, const char *msg, ...)
{
/*
! * Ignore error messages from libxml
*/
}
static boolean_t
libbrand_initialize()
{
static mutex_t initialize_lock = DEFAULTMUTEX;
--- 101,128 ----
static char i_curr_arch[MAXNAMELEN];
static char i_curr_zone[ZONENAME_MAX];
/*ARGSUSED*/
static void
! brand_warning_func(void *ctx, const char *msg, ...)
{
/*
! * Ignore warning messages from libxml
*/
}
+ /*ARGSUSED*/
+ static void
+ brand_error_func(void *ctx, const char *msg, ...)
+ {
+ va_list args;
+
+ va_start(args, msg);
+ (void) vfprintf(stderr, msg, args);
+ va_end(args);
+ }
+
static boolean_t
libbrand_initialize()
{
static mutex_t initialize_lock = DEFAULTMUTEX;
*** 200,210 ****
if ((cvp = xmlNewValidCtxt()) == NULL) {
xmlFreeDoc(doc);
return (NULL);
}
cvp->error = brand_error_func;
! cvp->warning = brand_error_func;
valid = xmlValidateDocument(cvp, doc);
xmlFreeValidCtxt(cvp);
if (valid == 0) {
xmlFreeDoc(doc);
return (NULL);
--- 212,222 ----
if ((cvp = xmlNewValidCtxt()) == NULL) {
xmlFreeDoc(doc);
return (NULL);
}
cvp->error = brand_error_func;
! cvp->warning = brand_warning_func;
valid = xmlValidateDocument(cvp, doc);
xmlFreeValidCtxt(cvp);
if (valid == 0) {
xmlFreeDoc(doc);
return (NULL);