]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
logging: confirm that we want to ignore a write error
authorJim Meyering <meyering@redhat.com>
Mon, 18 Jan 2010 10:51:01 +0000 (11:51 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 19 Jan 2010 20:28:41 +0000 (21:28 +0100)
* 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+.

.gnulib
bootstrap
src/util/logging.c

diff --git a/.gnulib b/.gnulib
index 4c52807f41f238cf0e352317b2dc54f9ba0f0c4f..146d9145073e62a2096a2d6b33f75e93908fedf3 160000 (submodule)
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 4c52807f41f238cf0e352317b2dc54f9ba0f0c4f
+Subproject commit 146d9145073e62a2096a2d6b33f75e93908fedf3
index c07d85158e1f1cf24cc68e379d3ac0f772212a09..aec5d055039690bd0bf78611413e59a480abe6db 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -76,6 +76,7 @@ getpass
 gettext
 gitlog-to-changelog
 gnumakefile
+ignore-value
 inet_pton
 ioctl
 maintainer-makefile
index 6bd8469c8ddbcf21e5a6ce81de24d382f6352614..3b3c3090436a2ddfdac83e8c7b12815d89e45f14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
  * modify it under the terms of the GNU Lesser General Public
@@ -34,6 +34,7 @@
 #include <syslog.h>
 #endif
 
+#include "ignore-value.h"
 #include "logging.h"
 #include "memory.h"
 #include "util.h"
@@ -579,7 +580,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
                                msg, len, virLogOutputs[i].data);
     }
     if ((virLogNbOutputs == 0) && (flags != 1))
-        safewrite(2, msg, len);
+        ignore_value (safewrite(STDERR_FILENO, msg, len));
     virLogUnlock();
 
     VIR_FREE(msg);