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 - nvpair_create_stringf: use the...



details:   https://anonhg.NetBSD.org/src/rev/050cd0f73476
branches:  trunk
changeset: 457832:050cd0f73476
user:      rmind <rmind%NetBSD.org@localhost>
date:      Tue Jul 23 00:49:16 2019 +0000

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

diffstat:

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

diffs (82 lines):

diff -r 27ce0a7a5385 -r 050cd0f73476 sys/external/bsd/libnv/dist/nv.h
--- a/sys/external/bsd/libnv/dist/nv.h  Mon Jul 22 17:34:31 2019 +0000
+++ b/sys/external/bsd/libnv/dist/nv.h  Tue Jul 23 00:49:16 2019 +0000
@@ -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_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);
diff -r 27ce0a7a5385 -r 050cd0f73476 sys/external/bsd/libnv/dist/nvlist.c
--- a/sys/external/bsd/libnv/dist/nvlist.c      Mon Jul 22 17:34:31 2019 +0000
+++ b/sys/external/bsd/libnv/dist/nvlist.c      Tue Jul 23 00:49:16 2019 +0000
@@ -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 @@
        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, ...)
 {
diff -r 27ce0a7a5385 -r 050cd0f73476 sys/external/bsd/libnv/dist/nvpair.c
--- a/sys/external/bsd/libnv/dist/nvpair.c      Mon Jul 22 17:34:31 2019 +0000
+++ b/sys/external/bsd/libnv/dist/nvpair.c      Tue Jul 23 00:49:16 2019 +0000
@@ -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 @@
        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 @@
        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);



Home | Main Index | Thread Index | Old Index