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>
qemud.c: use virStrerror, not strerror

View File

@ -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;
}

View File

@ -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;