From: <arei.gonglei@huawei.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, weidong.huang@huawei.com,
qemu-trivial@nongnu.org, mjt@tls.msk.ru, armbru@redhat.com,
Gonglei <arei.gonglei@huawei.com>,
pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH 2/3] os-posix: remove confused errno
Date: Fri, 26 Sep 2014 16:14:31 +0800 [thread overview]
Message-ID: <1411719272-9788-3-git-send-email-arei.gonglei@huawei.com> (raw)
In-Reply-To: <1411719272-9788-1-git-send-email-arei.gonglei@huawei.com>
From: Gonglei <arei.gonglei@huawei.com>
If we get inside the 'else if (status == 1)' conditional,
then we know that read() succeeded, and therefore errno is
unspecified. Printing strerror(errno) on a random value
is not helpful.
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
os-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/os-posix.c b/os-posix.c
index f0564ef..e31a099 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -226,7 +226,7 @@ void os_daemonize(void)
exit(1);
}
else if (status == 1) {
- fprintf(stderr, "Could not acquire pidfile: %s\n", strerror(errno));
+ fprintf(stderr, "Could not acquire pidfile\n");
exit(1);
} else {
exit(0);
--
1.7.12.4
next prev parent reply other threads:[~2014-09-26 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 8:14 [Qemu-devel] [PATCH 0/3] os-posix: improve the error message printing arei.gonglei
2014-09-26 8:14 ` [Qemu-devel] [PATCH 1/3] os-posix: change tab to space avoid violating coding style arei.gonglei
2014-09-26 8:14 ` arei.gonglei [this message]
2014-09-26 8:14 ` [Qemu-devel] [PATCH 3/3] os-posix: report error message when lock file failed arei.gonglei
2014-09-26 8:27 ` [Qemu-devel] [PATCH 0/3] os-posix: improve the error message printing Paolo Bonzini
2014-09-26 8:32 ` Gonglei (Arei)
2014-09-26 17:22 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411719272-9788-3-git-send-email-arei.gonglei@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.