summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2012-09-06 13:43:48 +0000
committermm <mm@FreeBSD.org>2012-09-06 13:43:48 +0000
commit74c41527034bc40a02b17276aeab72d11fd5ae39 (patch)
treec256d01e546ae8f2ee3d4cd11d017b8f0d60c86b /sys/cddl/compat
parent53b4991234ec7b7754647f1ec70e0555c8e94f2d (diff)
downloadFreeBSD-src-74c41527034bc40a02b17276aeab72d11fd5ae39.zip
FreeBSD-src-74c41527034bc40a02b17276aeab72d11fd5ae39.tar.gz
Make r230454 more readable and vendor-like.
PR: kern/171380 MFC after: 3 days
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r--sys/cddl/compat/opensolaris/sys/sid.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/sid.h b/sys/cddl/compat/opensolaris/sys/sid.h
index cc3ca3b..26bfdaa 100644
--- a/sys/cddl/compat/opensolaris/sys/sid.h
+++ b/sys/cddl/compat/opensolaris/sys/sid.h
@@ -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));
}
OpenPOWER on IntegriCloud