don't include raw errno in diagnostics

* src/uml_driver.c (umlStartVMDaemon): Don't print raw errno value.
* qemud/remote.c (remoteDispatchAuthSaslInit): Likewise.
This commit is contained in:
Jim Meyering 2009-02-05 16:28:15 +00:00
parent d2758fa13e
commit d22a844b46
3 changed files with 22 additions and 16 deletions

View File

@ -1,3 +1,9 @@
Thu Feb 5 17:03:35 +0100 2009 Jim Meyering <meyering@redhat.com>
don't include raw errno in diagnostics
* src/uml_driver.c (umlStartVMDaemon): Don't print raw errno value.
* qemud/remote.c (remoteDispatchAuthSaslInit): Likewise.
Thu Feb 5 17:03:35 +0100 2009 Jim Meyering <meyering@redhat.com> Thu Feb 5 17:03:35 +0100 2009 Jim Meyering <meyering@redhat.com>
qemud.c: use virStrerror, not strerror qemud.c: use virStrerror, not strerror

View File

@ -1,7 +1,7 @@
/* /*
* remote.c: code handling remote requests (from remote_internal.c) * 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 * 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
@ -2572,8 +2572,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server,
salen = sizeof(sa); salen = sizeof(sa);
if (getsockname(client->fd, (struct sockaddr*)&sa, &salen) < 0) { if (getsockname(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
remoteDispatchFormatError(rerr, remoteDispatchFormatError(rerr,
_("failed to get sock address %d (%s)"), _("failed to get sock address: %s"),
errno, strerror(errno)); strerror(errno));
goto error; goto error;
} }
if ((localAddr = addrToString(rerr, &sa, salen)) == NULL) { if ((localAddr = addrToString(rerr, &sa, salen)) == NULL) {
@ -2583,8 +2583,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server,
/* Get remote address in form IPADDR:PORT */ /* Get remote address in form IPADDR:PORT */
salen = sizeof(sa); salen = sizeof(sa);
if (getpeername(client->fd, (struct sockaddr*)&sa, &salen) < 0) { if (getpeername(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
remoteDispatchFormatError(rerr, _("failed to get peer address %d (%s)"), remoteDispatchFormatError(rerr, _("failed to get peer address: %s"),
errno, strerror(errno)); strerror(errno));
VIR_FREE(localAddr); VIR_FREE(localAddr);
goto error; goto error;
} }

View File

@ -1,7 +1,7 @@
/* /*
* uml_driver.c: core driver methods for managing UML guests * 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 * Copyright (C) 2006-2008 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -791,26 +791,26 @@ static int umlStartVMDaemon(virConnectPtr conn,
tmp = progenv; tmp = progenv;
while (*tmp) { while (*tmp) {
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile %d: %s\n"), umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
errno, strerror(errno)); strerror(errno));
if (safewrite(logfd, " ", 1) < 0) if (safewrite(logfd, " ", 1) < 0)
umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile %d: %s\n"), umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
errno, strerror(errno)); strerror(errno));
tmp++; tmp++;
} }
tmp = argv; tmp = argv;
while (*tmp) { while (*tmp) {
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"), umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
errno, strerror(errno)); strerror(errno));
if (safewrite(logfd, " ", 1) < 0) if (safewrite(logfd, " ", 1) < 0)
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"), umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
errno, strerror(errno)); strerror(errno));
tmp++; tmp++;
} }
if (safewrite(logfd, "\n", 1) < 0) if (safewrite(logfd, "\n", 1) < 0)
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile %d: %s\n"), umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
errno, strerror(errno)); strerror(errno));
vm->monitor = -1; vm->monitor = -1;