[libvirt] [PATCH 6/9] don't include raw errno in diagnostics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jim Meyering <meyering@xxxxxxxxxx>

* src/uml_driver.c (umlStartVMDaemon): Don't print raw errno value.
* qemud/remote.c (remoteDispatchAuthSaslInit): Likewise.
---
 qemud/remote.c   |   10 +++++-----
 src/uml_driver.c |   22 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/qemud/remote.c b/qemud/remote.c
index d064d61..2e0c48e 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -1,7 +1,7 @@
 /*
  * remote.c: code handling remote requests (from remote_internal.c)
  *
- * Copyright (C) 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2007, 2008, 2009 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
@@ -2572,8 +2572,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server,
     salen = sizeof(sa);
     if (getsockname(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
         remoteDispatchFormatError(rerr,
-                                  _("failed to get sock address %d (%s)"),
-                                  errno, strerror(errno));
+                                  _("failed to get sock address: %s"),
+                                  strerror(errno));
         goto error;
     }
     if ((localAddr = addrToString(rerr, &sa, salen)) == NULL) {
@@ -2583,8 +2583,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server,
     /* Get remote address in form  IPADDR:PORT */
     salen = sizeof(sa);
     if (getpeername(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
-        remoteDispatchFormatError(rerr, _("failed to get peer address %d (%s)"),
-                                  errno, strerror(errno));
+        remoteDispatchFormatError(rerr, _("failed to get peer address: %s"),
+                                  strerror(errno));
         VIR_FREE(localAddr);
         goto error;
     }
diff --git a/src/uml_driver.c b/src/uml_driver.c
index 1d12406..0fe2fac 100644
--- a/src/uml_driver.c
+++ b/src/uml_driver.c
@@ -1,7 +1,7 @@
 /*
  * uml_driver.c: core driver methods for managing UML guests
  *
- * Copyright (C) 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -791,26 +791,26 @@ static int umlStartVMDaemon(virConnectPtr conn,
     tmp = progenv;
     while (*tmp) {
         if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
-            umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile %d: %s\n"),
-                   errno, strerror(errno));
+            umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
+                   strerror(errno));
         if (safewrite(logfd, " ", 1) < 0)
-            umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile %d: %s\n"),
-                   errno, strerror(errno));
+            umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
+                   strerror(errno));
         tmp++;
     }
     tmp = argv;
     while (*tmp) {
         if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
-            umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"),
-                   errno, strerror(errno));
+            umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
+                   strerror(errno));
         if (safewrite(logfd, " ", 1) < 0)
-            umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"),
-                   errno, strerror(errno));
+            umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
+                   strerror(errno));
         tmp++;
     }
     if (safewrite(logfd, "\n", 1) < 0)
-        umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"),
-                 errno, strerror(errno));
+        umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
+                 strerror(errno));

     vm->monitor = -1;

-- 
1.6.1.2.418.gd79e6

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]