svn commit: r302662 - vendor-sys/illumos/dist/common/nvpair vendor/illumos/dist/lib/libnvpair

Andriy Gapon avg at FreeBSD.org
Tue Jul 12 12:06:00 UTC 2016


Author: avg
Date: Tue Jul 12 12:05:58 2016
New Revision: 302662
URL: https://svnweb.freebsd.org/changeset/base/302662

Log:
  6447 handful of nvpair cleanups
  
  illumos/illumos-gate at 759e89be359f2af635e4122d147df56bce948773
  https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bce948773
  
  https://www.illumos.org/issues/6447
    I got a patch from someone who uses nvpair code outside of illumos. It fixes a
    couple of gcc warnings/bugs for him.
       1. silence uninitialized use warnings
       2. add parentheses around assignment used as truth value
       3. fix printf format specifier (ll is for integers only)
       4. strstr, strspn, strcspn, and strcmp are declared in string.h, not
          strings.h.
       5. avoid scanning integer into boolean variable
  
  Reviewed by: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
  Reviewed by: Andy Stormont <astormont at racktopsystems.com>
  Reviewed by: Garrett D'Amore <garrett at damore.org>
  Approved by: Robert Mustacchi <rm at joyent.com>
  Author: Steve Dougherty <sdougherty at barracuda.com>

Modified:
  vendor-sys/illumos/dist/common/nvpair/nvpair.c

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/lib/libnvpair/libnvpair.c

Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c
==============================================================================
--- vendor-sys/illumos/dist/common/nvpair/nvpair.c	Tue Jul 12 12:03:00 2016	(r302661)
+++ vendor-sys/illumos/dist/common/nvpair/nvpair.c	Tue Jul 12 12:05:58 2016	(r302662)
@@ -1624,6 +1624,8 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nv
 	if ((nvl == NULL) || (name == NULL))
 		return (EINVAL);
 
+	sepp = NULL;
+	idx = 0;
 	/* step through components of name */
 	for (np = name; np && *np; np = sepp) {
 		/* ensure unique names */
@@ -2381,7 +2383,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp,
 	 */
 	nv_priv_init(&nvpriv, nva, 0);
 
-	if (err = nvlist_size(nvl, &alloc_size, encoding))
+	if ((err = nvlist_size(nvl, &alloc_size, encoding)))
 		return (err);
 
 	if ((buf = nv_mem_zalloc(&nvpriv, alloc_size)) == NULL)


More information about the svn-src-all mailing list