Module Name:    src
Committed By:   rmind
Date:           Tue Jul 23 00:49:16 UTC 2019

Modified Files:
        src/sys/external/bsd/libnv/dist: nv.h nvlist.c nvpair.c

Log Message:
- nvpair_create_stringf: use the in-kernel vasprintf().
- Make nvlist_add_stringf() availabe in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/libnv/dist/nv.h
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/libnv/dist/nvlist.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/libnv/dist/nvpair.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/nv.h
diff -u src/sys/external/bsd/libnv/dist/nv.h:1.2 src/sys/external/bsd/libnv/dist/nv.h:1.3
--- src/sys/external/bsd/libnv/dist/nv.h:1.2	Sat Sep  8 14:02:15 2018
+++ src/sys/external/bsd/libnv/dist/nv.h	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nv.h,v 1.2 2018/09/08 14:02:15 christos Exp $	*/
+/*	$NetBSD: nv.h,v 1.3 2019/07/23 00:49:16 rmind Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -152,9 +152,7 @@ void nvlist_add_bool(nvlist_t *nvl, cons
 void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value);
 void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value);
 void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4);
-#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED)
 void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0);
-#endif
 void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value);
 void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, size_t size);
 void nvlist_add_bool_array(nvlist_t *nvl, const char *name, const bool *value, size_t nitems);

Index: src/sys/external/bsd/libnv/dist/nvlist.c
diff -u src/sys/external/bsd/libnv/dist/nvlist.c:1.7 src/sys/external/bsd/libnv/dist/nvlist.c:1.8
--- src/sys/external/bsd/libnv/dist/nvlist.c:1.7	Tue Feb 12 12:49:23 2019
+++ src/sys/external/bsd/libnv/dist/nvlist.c	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvlist.c,v 1.7 2019/02/12 12:49:23 rmind Exp $	*/
+/*	$NetBSD: nvlist.c,v 1.8 2019/07/23 00:49:16 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.7 2019/02/12 12:49:23 rmind Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.8 2019/07/23 00:49:16 rmind Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1507,7 +1507,7 @@ nvlist_add_nvpair(nvlist_t *nvl, const n
 	nvpair_insert(&nvl->nvl_head, newnvp, nvl);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__NetBSD__)
+#if !defined(_STANDALONE)
 void
 nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...)
 {

Index: src/sys/external/bsd/libnv/dist/nvpair.c
diff -u src/sys/external/bsd/libnv/dist/nvpair.c:1.6 src/sys/external/bsd/libnv/dist/nvpair.c:1.7
--- src/sys/external/bsd/libnv/dist/nvpair.c:1.6	Fri Feb 15 22:49:24 2019
+++ src/sys/external/bsd/libnv/dist/nvpair.c	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvpair.c,v 1.6 2019/02/15 22:49:24 rmind Exp $	*/
+/*	$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind 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.6 2019/02/15 22:49:24 rmind Exp $");
+__RCSID("$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1191,7 +1191,7 @@ nvpair_name(const nvpair_t *nvp)
 	return (nvp->nvp_name);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__NetBSD__)
+#if !defined(_STANDALONE)
 nvpair_t *
 nvpair_create_stringf(const char *name, const char *valuefmt, ...)
 {
@@ -1212,7 +1212,7 @@ nvpair_create_stringv(const char *name, 
 	char *str;
 	int len;
 
-	len = nv_vasprintf(&str, valuefmt, valueap);
+	len = vasprintf(&str, valuefmt, valueap);
 	if (len < 0)
 		return (NULL);
 	nvp = nvpair_create_string(name, str);

Reply via email to