Make r230454 more readable and vendor-like.

PR:		kern/171380
MFC after:	3 days
This commit is contained in:
Martin Matuska 2012-09-06 13:43:48 +00:00
parent 12780a595e
commit 1f3d1b1181
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240162

View File

@ -30,7 +30,8 @@
#define _OPENSOLARIS_SYS_SID_H_
typedef struct ksiddomain {
char kd_name[1]; /* Domain part of SID */
char *kd_name; /* Domain part of SID */
uint_t kd_len;
} ksiddomain_t;
typedef void ksid_t;
@ -38,8 +39,12 @@ static __inline ksiddomain_t *
ksid_lookupdomain(const char *domain)
{
ksiddomain_t *kd;
size_t len;
kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP);
len = strlen(domain) + 1;
kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
kd->kd_len = (uint_t)len;
kd->kd_name = kmem_alloc(len, KM_SLEEP);
strcpy(kd->kd_name, domain);
return (kd);
}
@ -48,6 +53,7 @@ static __inline void
ksiddomain_rele(ksiddomain_t *kd)
{
kmem_free(kd->kd_name, kd->kd_len);
kmem_free(kd, sizeof(*kd));
}