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 libnv: fix some NetBSD wrappers.
details: https://anonhg.NetBSD.org/src/rev/bc0970c6efcf
branches: trunk
changeset: 433588:bc0970c6efcf
user: rmind <rmind%NetBSD.org@localhost>
date: Sat Sep 22 17:13:30 2018 +0000
description:
libnv: fix some NetBSD wrappers.
diffstat:
sys/external/bsd/libnv/dist/nv_impl.h | 6 +++---
sys/external/bsd/libnv/dist/nv_kern_netbsd.c | 10 +++++-----
sys/external/bsd/libnv/dist/nvlist.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (83 lines):
diff -r ae6e00925b18 -r bc0970c6efcf sys/external/bsd/libnv/dist/nv_impl.h
--- a/sys/external/bsd/libnv/dist/nv_impl.h Sat Sep 22 16:22:22 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nv_impl.h Sat Sep 22 17:13:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nv_impl.h,v 1.3 2018/09/08 14:12:53 christos Exp $ */
+/* $NetBSD: nv_impl.h,v 1.4 2018/09/22 17:13:30 rmind Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -82,11 +82,11 @@
#else /* USERLAND */
# define nv_malloc(size) malloc((size))
-# define nv_calloc(n, size) calloc(n, size)
# define nv_realloc(buf, size) realloc((buf), (size))
# define nv_free(buf) free((buf))
-# define nv_strdup(buf) strdup(buf)
# define nv_vasprintf(ptr, ...) vasprintf(ptr, __VA_ARGS__)
+void *nv_calloc(size_t, size_t);
+char *nv_strdup(const char *);
# define ERRNO_SET(var) do { \
errno = (var); \
diff -r ae6e00925b18 -r bc0970c6efcf sys/external/bsd/libnv/dist/nv_kern_netbsd.c
--- a/sys/external/bsd/libnv/dist/nv_kern_netbsd.c Sat Sep 22 16:22:22 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nv_kern_netbsd.c Sat Sep 22 17:13:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $ */
+/* $NetBSD: nv_kern_netbsd.c,v 1.3 2018/09/22 17:13:30 rmind Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $");
+__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.3 2018/09/22 17:13:30 rmind Exp $");
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <sys/mman.h>
@@ -198,11 +198,11 @@
void *
nv_calloc(size_t n, size_t s)
{
- n *= s;
- void *buf = nv_malloc(n);
+ const size_t len = n * s;
+ void *buf = nv_malloc(len);
if (buf == NULL)
return NULL;
- memset(buf, 0, n);
+ memset(buf, 0, len);
return buf;
}
diff -r ae6e00925b18 -r bc0970c6efcf sys/external/bsd/libnv/dist/nvlist.c
--- a/sys/external/bsd/libnv/dist/nvlist.c Sat Sep 22 16:22:22 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nvlist.c Sat Sep 22 17:13:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nvlist.c,v 1.5 2018/09/11 02:20:31 christos Exp $ */
+/* $NetBSD: nvlist.c,v 1.6 2018/09/22 17:13:30 rmind Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: head/sys/contrib/libnv/nvlist.c 335347 2018-06-18 22:57:32Z oshogbo $");
#else
-__RCSID("$NetBSD: nvlist.c,v 1.5 2018/09/11 02:20:31 christos Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.6 2018/09/22 17:13:30 rmind Exp $");
#endif
#include <sys/param.h>
@@ -1180,7 +1180,7 @@
goto fail;
nvlist_set_parent(tmpnvl, nvp);
break;
-#if !defined(_KERNEL) && !defined(_STANDALONE)
+#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__NetBSD__)
case NV_TYPE_DESCRIPTOR:
ptr = nvpair_unpack_descriptor(isbe, nvp, ptr, &left,
fds, nfds);
Home |
Main Index |
Thread Index |
Old Index