mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
logging: confirm that we want to ignore a write error
* src/util/logging.c (virLogMessage): Include "ignore-value.h". Use it to ignore the return value of safewrite. Use STDERR_FILENO, rather than "2". * bootstrap (modules): Add ignore-value. * gnulib: Update to latest, for ignore-value that is now LGPLv2+.
This commit is contained in:
parent
8cfc4c9a03
commit
eb895e7407
2
.gnulib
2
.gnulib
@ -1 +1 @@
|
|||||||
Subproject commit 4c52807f41f238cf0e352317b2dc54f9ba0f0c4f
|
Subproject commit 146d9145073e62a2096a2d6b33f75e93908fedf3
|
@ -76,6 +76,7 @@ getpass
|
|||||||
gettext
|
gettext
|
||||||
gitlog-to-changelog
|
gitlog-to-changelog
|
||||||
gnumakefile
|
gnumakefile
|
||||||
|
ignore-value
|
||||||
inet_pton
|
inet_pton
|
||||||
ioctl
|
ioctl
|
||||||
maintainer-makefile
|
maintainer-makefile
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* logging.c: internal logging and debugging
|
* logging.c: internal logging and debugging
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Red Hat, Inc.
|
* Copyright (C) 2008, 2010 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -34,6 +34,7 @@
|
|||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ignore-value.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -579,7 +580,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
|
|||||||
msg, len, virLogOutputs[i].data);
|
msg, len, virLogOutputs[i].data);
|
||||||
}
|
}
|
||||||
if ((virLogNbOutputs == 0) && (flags != 1))
|
if ((virLogNbOutputs == 0) && (flags != 1))
|
||||||
safewrite(2, msg, len);
|
ignore_value (safewrite(STDERR_FILENO, msg, len));
|
||||||
virLogUnlock();
|
virLogUnlock();
|
||||||
|
|
||||||
VIR_FREE(msg);
|
VIR_FREE(msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user