Module Name: src
Committed By: christos
Date: Sat Sep 8 14:12:53 UTC 2018
Modified Files:
src/sys/external/bsd/libnv/dist: dnvlist.c nv_impl.h nv_kern_netbsd.c
nvlist.c
Log Message:
FIx userland build
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/libnv/dist/dnvlist.c \
src/sys/external/bsd/libnv/dist/nv_impl.h \
src/sys/external/bsd/libnv/dist/nvlist.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/libnv/dist/dnvlist.c
diff -u src/sys/external/bsd/libnv/dist/dnvlist.c:1.2 src/sys/external/bsd/libnv/dist/dnvlist.c:1.3
--- src/sys/external/bsd/libnv/dist/dnvlist.c:1.2 Sat Sep 8 10:02:15 2018
+++ src/sys/external/bsd/libnv/dist/dnvlist.c Sat Sep 8 10:12:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dnvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $ */
+/* $NetBSD: dnvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -35,7 +35,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: head/sys/contrib/libnv/dnvlist.c 328474 2018-01-27 12:58:21Z oshogbo $");
#else
-__RCSID("$NetBSD: dnvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $");
+__RCSID("$NetBSD: dnvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $");
#endif
#if defined(_KERNEL) || defined(_STANDALONE)
@@ -57,7 +57,7 @@ __RCSID("$NetBSD: dnvlist.c,v 1.2 2018/0
#include <stdlib.h>
#endif
-#ifndef __FreeBSD__
+#ifdef __FreeBSD__
#include <sys/dnv.h>
#include <sys/nv.h>
#else
Index: src/sys/external/bsd/libnv/dist/nv_impl.h
diff -u src/sys/external/bsd/libnv/dist/nv_impl.h:1.2 src/sys/external/bsd/libnv/dist/nv_impl.h:1.3
--- src/sys/external/bsd/libnv/dist/nv_impl.h:1.2 Sat Sep 8 10:02:15 2018
+++ src/sys/external/bsd/libnv/dist/nv_impl.h Sat Sep 8 10:12:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: nv_impl.h,v 1.2 2018/09/08 14:02:15 christos Exp $ */
+/* $NetBSD: nv_impl.h,v 1.3 2018/09/08 14:12:53 christos Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -56,58 +56,58 @@ typedef struct nvpair nvpair_t;
#define NV_FLAG_IN_ARRAY 0x100
#if defined(_KERNEL)
-#define nv_malloc(size) malloc((size), M_NVLIST, M_WAITOK)
-#ifdef __FreeBSD__
-#define nv_calloc(n, size) mallocarray((n), (size), M_NVLIST, \
+# define nv_malloc(size) malloc((size), M_NVLIST, M_WAITOK)
+# ifdef __FreeBSD__
+# define nv_calloc(n, size) mallocarray((n), (size), M_NVLIST, \
M_WAITOK | M_ZERO)
-#else
+# else
extern void *nv_calloc(size_t, size_t);
-#endif
-#define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \
+# endif
+# define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \
M_WAITOK)
-#define nv_free(buf) free((buf), M_NVLIST)
-#ifdef __FreeBSD__
-#define nv_strdup(buf) strdup((buf), M_NVLIST)
-#else
+# define nv_free(buf) free((buf), M_NVLIST)
+# ifdef __FreeBSD__
+# define nv_strdup(buf) strdup((buf), M_NVLIST)
+# else
extern char *nv_strdup(const char *);
-#endif
-#define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__)
-#endif
+# endif
+# define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__)
#elif defined(_STANDALONE)
extern void *nv_malloc(size_t);
extern void *nv_calloc(size_t, size_t);
extern void *nv_realloc(void *, size_t);
extern void nv_free(void *);
extern char *nv_strdup(const char *);
-#define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__)
-#else
+# define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__)
+#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__)
-
-#define ERRNO_SET(var) do { errno = (var); } while (0)
-#define ERRNO_SAVE() do { \
+# 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__)
+
+# define ERRNO_SET(var) do { \
+ errno = (var); \
+ } while (/*CONSTCOND*/0)
+# define ERRNO_SAVE() do { \
int _serrno; \
- \
_serrno = errno
-#define ERRNO_RESTORE() errno = _serrno; \
- } while (0)
+# define ERRNO_RESTORE() errno = _serrno; \
+ } while (/*CONSTCOND*/0)
-#define ERRNO_OR_DEFAULT(default) (errno == 0 ? (default) : errno)
+# define ERRNO_OR_DEFAULT(default) (errno == 0 ? (default) : errno)
#endif
#ifndef ERRNO_SET
-#define ERRNO_SET(var) do { } while (/*CONSTCOND*/0)
-#define ERRNO_SAVE() do { do { } while(/*CONSTCOND*/0)
-#define ERRNO_RESTORE() } while (/*CONSTCOND*/0)
-
-#define ERRNO_OR_DEFAULT(default) (default)
+# define ERRNO_SET(var) do { } while (/*CONSTCOND*/0)
+# define ERRNO_SAVE() do { do { } while(/*CONSTCOND*/0)
+# define ERRNO_RESTORE() } while (/*CONSTCOND*/0)
+
+# define ERRNO_OR_DEFAULT(default) (default)
#endif
int *nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp);
Index: src/sys/external/bsd/libnv/dist/nvlist.c
diff -u src/sys/external/bsd/libnv/dist/nvlist.c:1.2 src/sys/external/bsd/libnv/dist/nvlist.c:1.3
--- src/sys/external/bsd/libnv/dist/nvlist.c:1.2 Sat Sep 8 10:02:15 2018
+++ src/sys/external/bsd/libnv/dist/nvlist.c Sat Sep 8 10:12:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: nvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $ */
+/* $NetBSD: nvlist.c,v 1.3 2018/09/08 14:12:53 christos 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.2 2018/09/08 14:02:15 christos Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $");
#endif
#include <sys/param.h>
@@ -77,7 +77,7 @@ __RCSID("$NetBSD: nvlist.c,v 1.2 2018/09
#ifdef __FreeBSD__
#include <sys/nv.h>
#else
-#incude "nv.h"
+#include "nv.h"
#endif
#include "nv_impl.h"
Index: src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c
diff -u src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.1 src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.2
--- src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c:1.1 Sat Sep 8 10:02:15 2018
+++ src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c Sat Sep 8 10:12:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: nv_kern_netbsd.c,v 1.1 2018/09/08 14:02:15 christos Exp $ */
+/* $NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/ctypes.h>
-__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.1 2018/09/08 14:02:15 christos Exp $");
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $");
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <sys/mman.h>