From: Jens Axboe <axboe@kernel.dk>
To: Erwan Velu <erwan@enovance.com>, fio@vger.kernel.org
Subject: Re: Curious code in init()
Date: Wed, 02 Apr 2014 08:24:55 -0600 [thread overview]
Message-ID: <533C1DB7.90206@kernel.dk> (raw)
In-Reply-To: <533BCB67.4050709@enovance.com>
On 2014-04-02 02:33, Erwan Velu wrote:
> Hey Jens,
>
> The following code is pretty confusing for me :
> http://git.kernel.dk/?p=fio.git;a=blob;f=init.c;h=c3996a76c12840e3ab3cf6514e5d5dce611a1077;hb=HEAD#l1962
>
>
> The "if (nr_clients && fio_clients_connect()) {" is using the do_exit
> concept while being after the code that manage it and does a return -1
> while exit code is set to 1.
>
> I don't get how it should be fixed.
> 1- we shall move the if nr_clients before the "if (do_exit", remove the
> return -1 and adjust the exit_code ?
> 2- we shall get rid of the do_exit & exit code semantic of the if
> nr_clients.
>
> What was the intent while reading the code ? ;o)
It should probably just be turned into an exit(1) or similar exit code.
The current code will work to the extent that it will properly exit,
however it wont signal the error correctly in the return value.
--
Jens Axboe
prev parent reply other threads:[~2014-04-02 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 8:33 Curious code in init() Erwan Velu
2014-04-02 14:24 ` Jens Axboe [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=533C1DB7.90206@kernel.dk \
--to=axboe@kernel.dk \
--cc=erwan@enovance.com \
--cc=fio@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