From: "Gustavo F. Padovan" <gustavo@las.ic.unicamp.br>
To: David Vrabel <david.vrabel@csr.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/6] Change fprintf(stderr,...) to perror()
Date: Mon, 16 Feb 2009 09:37:46 -0300 [thread overview]
Message-ID: <6b53b1990902160437q627d2222r590fc2c82fa249aa@mail.gmail.com> (raw)
In-Reply-To: <49995A47.8070401@csr.com>
On Mon, Feb 16, 2009 at 9:21 AM, David Vrabel <david.vrabel@csr.com> wrote:
> Gustavo F. Padovan wrote:
>>
>> @@ -1922,7 +1922,7 @@ static void cmd_lst(int dev_id, int argc, char **argv)
>> if (dev_id < 0) {
>> dev_id = hci_for_each_dev(HCI_UP, find_conn, (long) &bdaddr);
>> if (dev_id < 0) {
>> - fprintf(stderr, "Not connected.\n");
>> + perror("Not connected.");
>> exit(1);
>> }
>> }
>
> You should only perror() if errno is valid for the error being reported.
> Otherwise you're going to get odd messages like:
>
> Not connected.: Success
Ok. You are right.
>
> David
> --
> David Vrabel, Senior Software Engineer, Drivers
> CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562
> Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/
>
--
Gustavo F. Padovan
Computer Engineering Student
Institute of Computing - IC
University of Campinas - UNICAMP
email: gustavo@las.ic.unicamp.br
gtalk: gfpadovan@gmail.com
mobile: +55 19 81030803
prev parent reply other threads:[~2009-02-16 12:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 19:47 [PATCH 1/6] Fix more memory leaks in hcitool Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 2/6] hcitool: fix error message Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 3/6] Change fprintf(stderr,...) to perror() Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 4/6] remove verification before free Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 5/6] Remove unnecessary attribution Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 6/6] Make expand_name a void function Gustavo F. Padovan
2009-02-16 12:21 ` [PATCH 3/6] Change fprintf(stderr,...) to perror() David Vrabel
2009-02-16 12:37 ` Gustavo F. Padovan [this message]
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=6b53b1990902160437q627d2222r590fc2c82fa249aa@mail.gmail.com \
--to=gustavo@las.ic.unicamp.br \
--cc=david.vrabel@csr.com \
--cc=linux-bluetooth@vger.kernel.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