[PATCH 3/4] nss: Implement <nss_database.h>

DJ Delorie dj@redhat.com
Wed Jul 1 21:39:33 GMT 2020


"Carlos O'Donell" <carlos@redhat.com> writes:
> Suggest:
>
> /* Global NSS database state.  */
>
>> +static void *global_place;
>
> I suggest calling this something more descriptive. Please pick any
> name other than "global_place" which seems like a placeholder.

Went with:

/* Global NSS database state.  Underlying type is "struct
   nss_database_state *" but the allocate_once API requires
   "void *".  */
static void *global_database_state;

with suitable replacements throughout.

> Suggest:
>
> /* Allocate and return pointer to nss_database_state object or 
>    on failure return NULL.  */

Changed.

>> +static void *
>> +global_allocate (void *closure)
>
> Name this to match what you call "global_place" e.g. foo_allocate.

Went with:

global_state_allocate (void *closure)

"global_database_state_allocate" was a bit too verbose for my tastes but
I wanted the variable to be verbose.

> Suggest:
>
> /* Return pointer to global NSS database state, allocating as
>    required, or returning NULL on failure.  */

Changed.

>> +    /* Not our database (e.g., sudoers).  */
>
> Suggest:
>
> /* Not our database e.g. sudoers, automount etc.  */

Changed.



More information about the Libc-alpha mailing list