Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/libnv/dist Adapt for userland compilation



details:   https://anonhg.NetBSD.org/src/rev/6f67ab8e4588
branches:  trunk
changeset: 462084:6f67ab8e4588
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jul 24 14:25:56 2019 +0000

description:
Adapt for userland compilation

diffstat:

 sys/external/bsd/libnv/dist/nv_impl.h |  8 +++++++-
 sys/external/bsd/libnv/dist/nvpair.c  |  6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r ff921baf194c -r 6f67ab8e4588 sys/external/bsd/libnv/dist/nv_impl.h
--- a/sys/external/bsd/libnv/dist/nv_impl.h     Wed Jul 24 14:07:16 2019 +0000
+++ b/sys/external/bsd/libnv/dist/nv_impl.h     Wed Jul 24 14:25:56 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nv_impl.h,v 1.6 2019/02/12 12:49:23 rmind Exp $        */
+/*     $NetBSD: nv_impl.h,v 1.7 2019/07/24 14:25:56 martin Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -72,6 +72,11 @@
 extern void nv_free(void *);
 extern char *nv_strdup(const char *);
 # endif
+#ifdef __NetBSD__
+# define nv_kmem_free(B,L)             kmem_free(B,L)
+#else
+# define nv_kmem_free(B,L)             nv_free(B)
+#endif
 # define nv_vasprintf(ptr, ...)                vasprintf(ptr, M_NVLIST, __VA_ARGS__)
 #elif defined(_STANDALONE)
 extern void *nv_malloc(size_t);
@@ -86,6 +91,7 @@
 # define nv_realloc(buf, size)         realloc((buf), (size))
 # define nv_free(buf)                  free((buf))
 # define nv_vasprintf(ptr, ...)                vasprintf(ptr, __VA_ARGS__)
+# define nv_kmem_free(B,L)             nv_free(B)
 void *nv_calloc(size_t, size_t);
 char *nv_strdup(const char *);
 
diff -r ff921baf194c -r 6f67ab8e4588 sys/external/bsd/libnv/dist/nvpair.c
--- a/sys/external/bsd/libnv/dist/nvpair.c      Wed Jul 24 14:07:16 2019 +0000
+++ b/sys/external/bsd/libnv/dist/nvpair.c      Wed Jul 24 14:25:56 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvpair.c,v 1.10 2019/07/24 12:13:13 sevan Exp $        */
+/*     $NetBSD: nvpair.c,v 1.11 2019/07/24 14:25:56 martin Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvpair.c 335382 2018-06-19 18:43:02Z lwhsu $");
 #else
-__RCSID("$NetBSD: nvpair.c,v 1.10 2019/07/24 12:13:13 sevan Exp $");
+__RCSID("$NetBSD: nvpair.c,v 1.11 2019/07/24 14:25:56 martin Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1217,7 +1217,7 @@
        if (len < 0)
                return (NULL);
        nvp = nvpair_create_string(name, str);
-       kmem_free(str, len+1);
+       nv_kmem_free(str, len+1);
        return (nvp);
 }
 #endif



Home | Main Index | Thread Index | Old Index