From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: Marcel Holtmann <marcel@holtmann.org>,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair
Date: Fri, 17 May 2013 15:07:30 +0300 [thread overview]
Message-ID: <CABBYNZKtMZJ9oN_CFnZXGx221zqmFZBPyMHMjF1z8tdoHHmmtQ@mail.gmail.com> (raw)
In-Reply-To: <CAJdJm_NefGTEAgXrU7uZVeG0t11QnNG7UvsYh589dNrdYDrYqg@mail.gmail.com>
Hi Anderson,
On Fri, May 17, 2013 at 2:05 PM, Anderson Lizardo
<anderson.lizardo@openbossa.org> wrote:
> Hi Marcel,
>
> On Fri, May 17, 2013 at 1:14 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
>> Also I wonder why this is all so complicated.
>>
>> if (fd < 0) {
>> int n;
>>
>> n = read(fd, ...);
>> if (n < sizeof(...))
>> seed = time();
>>
>> close(fd);
>> } else
>> seed = time();
>
> I intentionally avoided nested if()'s and the duplicated "seed =
> time(...)" assignment because it seemed to actually make it more
> complex IMHO. I will change to the version above, but I don't see why
> it is more readable than my v2 (plus the changes you proposed above).
> My main concern for this specific code is still to get the build fixed
> :)
You can always create a helper function if the code gets too complicated.
--
Luiz Augusto von Dentz
next prev parent reply other threads:[~2013-05-17 12:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 16:25 [PATCH BlueZ 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Anderson Lizardo
2013-05-16 16:25 ` [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API Anderson Lizardo
2013-05-17 5:14 ` [PATCH BlueZ 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Marcel Holtmann
2013-05-17 11:05 ` Anderson Lizardo
2013-05-17 12:07 ` Luiz Augusto von Dentz [this message]
2013-05-17 14:31 ` [PATCH BlueZ v2 " Anderson Lizardo
2013-05-17 14:31 ` [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API Anderson Lizardo
2013-05-20 23:51 ` [PATCH BlueZ v2 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Johan Hedberg
2013-05-21 6:10 ` Marcel Holtmann
2013-05-21 11:02 ` Anderson Lizardo
2013-05-21 13:06 ` [PATCH BlueZ v3 " Anderson Lizardo
2013-05-21 13:06 ` [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API Anderson Lizardo
2013-05-28 13:25 ` [PATCH BlueZ v3 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Anderson Lizardo
2013-06-13 14:26 ` Johan Hedberg
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=CABBYNZKtMZJ9oN_CFnZXGx221zqmFZBPyMHMjF1z8tdoHHmmtQ@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=anderson.lizardo@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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).