From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-char: Print strerror message on failure
Date: Tue, 21 Jun 2011 18:18:57 +0200 [thread overview]
Message-ID: <4E00C471.3060802@redhat.com> (raw)
In-Reply-To: <m3y60v5fpd.fsf@blackfin.pond.sub.org>
Am 21.06.2011 18:09, schrieb Markus Armbruster:
> Kevin Wolf <kwolf@redhat.com> writes:
>
>> The only way for chardev drivers to communicate an error was to return a NULL
>> pointer, which resulted in an error message that said _that_ something went
>> wrong, but not _why_.
>>
>> This patch changes the interface to return 0/-errno and updates
>> qemu_chr_open_opts to use strerror to display a more helpful error message.
>
> Returning the result through a pointer is awkward. What about stuffing
> the error code into errno?
I generally like it better to return error codes explicitly instead of
storing them in some global variable where it tends to be trampled over
before you print the message. But if people prefer it that way, I can
redo the patch.
Kevin
next prev parent reply other threads:[~2011-06-21 16:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 11:29 [Qemu-devel] [PATCH] qemu-char: Print strerror message on failure Kevin Wolf
2011-06-21 15:33 ` Kevin Wolf
2011-06-21 16:09 ` Markus Armbruster
2011-06-21 16:18 ` Kevin Wolf [this message]
2011-06-22 17:24 ` Anthony Liguori
2011-07-23 16:53 ` Anthony Liguori
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=4E00C471.3060802@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).