[SSSD] [PATCH] sss_override: add -find and -show

Jakub Hrozek jhrozek at redhat.com
Thu Oct 22 11:28:04 UTC 2015


On Thu, Oct 22, 2015 at 01:17:45PM +0200, Pavel Březina wrote:
> >>+    do {
> >>+        objs = list_user_overrides(tmp_ctx, dom);
> >
> >Would you consider moving definition of objs closer to it's usage?
> >
> >>+        if (objs == NULL) {
> >>+            DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get override
> >>objects\n");
> >>+            ret = ENOMEM;
> >>+            goto done;
> >>+        }
> >>+
> >>+        for (i = 0; objs[i].orig_name != NULL; i++) {
> >You can move definition of i closer to its usage.
> 
> No to both considerations. In general I don't oppose to this coding style
> change but I would like to keep the style consistent within modules.

In general I do oppose to this coding style, sorry. I'm fine with:
    for (int i...)

But if you really need to declare variables inside a block, then usually
the block needs to be split into its own function.


More information about the sssd-devel mailing list