Re: "tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users

FUJITA Tomonori <[email protected]> Fri, 22 Aug 2014 19:23:17 +0900 (JST)
Newsgroups org.kernel.vger.stgt
Message-ID <20140822.192317.1898388363586166083.fujita.tomonori@lab.ntt.co.jp>
Hi,

On Fri, 15 Aug 2014 16:39:18 +1000
Phillip Brown <[email protected]> wrote:

> Problem seems to be with this 'if' statement in targets.c:system_show
> function
> 
> --------->> if (global_target.account.nr_inaccount) {
>                                int i, aid;
>                                concat_printf(b, _TAB1 "%s\n", "Account information:\n");
>                                for (i = 0; i < global_target.account.nr_inaccount; i++) {
>                                                aid = global_target.account.in_aids[i];
>                                                concat_printf(b, _TAB1 "%s\n",
>            __account_lookup_id(aid)->user);
>                                }
>                                if (global_target.account.out_aid) {
>                                                aid = global_target.account.out_aid;
>                                                concat_printf(b, _TAB1 "%s (outgoing)\n",
>            __account_lookup_id(aid)->user);
>                                }
>                }
> 
> Does there really need to be that test?

Probably, I wrote the above code but can't recall why. Looks like we
can remove the above 'if'. Can you send a patch?

Thanks!