[libvirt] [PATCH 1/4] util: process: Don't report OOM errors in helper

Peter Krempa pkrempa at redhat.com
Tue Sep 9 15:25:32 UTC 2014


virProcessTranslateStatus is used on error paths that should not spoil
the returned error. As the errors are ignored, use the quiet versions of
virAsprintf to create the message.
---
 src/util/virprocess.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 97cce4f..5bb2298 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -73,13 +73,13 @@ virProcessTranslateStatus(int status)
 {
     char *buf;
     if (WIFEXITED(status)) {
-        ignore_value(virAsprintf(&buf, _("exit status %d"),
-                                 WEXITSTATUS(status)));
+        ignore_value(virAsprintfQuiet(&buf, _("exit status %d"),
+                                      WEXITSTATUS(status)));
     } else if (WIFSIGNALED(status)) {
-        ignore_value(virAsprintf(&buf, _("fatal signal %d"),
-                                 WTERMSIG(status)));
+        ignore_value(virAsprintfQuiet(&buf, _("fatal signal %d"),
+                                      WTERMSIG(status)));
     } else {
-        ignore_value(virAsprintf(&buf, _("invalid value %d"), status));
+        ignore_value(virAsprintfQuiet(&buf, _("invalid value %d"), status));
     }
     return buf;
 }
-- 
2.0.2




More information about the libvir-list mailing list