--- old/usr/src/test/util-tests/tests/libsff/Makefile	Thu Nov 16 16:53:28 2017
+++ new/usr/src/test/util-tests/tests/libsff/Makefile	Thu Nov 16 16:53:28 2017
@@ -41,6 +41,8 @@
 	$(ERR_PROGS) \
 	libsff_strings
 
+LINTS = $(PROGS:%=%.ln)
+
 SCRIPTS = libsff
 
 include $(SRC)/cmd/Makefile.cmd
@@ -60,15 +62,21 @@
 $(ERR_PROGS)	:= LDLIBS += -lsff
 $(DIFF_PROGS)	:= LDLIBS += -lsff -lnvpair
 libsff_strings	:= LDLIBS += -lsff -lnvpair
+$(ERR_PROGS).ln	:= LDLIBS += -lsff
+$(DIFF_PROGS).ln	:= LDLIBS += -lsff -lnvpair
+libsff_strings.ln	:= LDLIBS += -lsff -lnvpair
 
 all: $(PROGS)
 
 install: all $(CMDS) $(OUTFILES)
 
-lint: lint_SRCS
+lint: $(LINTS)
 
+%.ln: %.c
+	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 $< $(LDLIBS)
+
 clobber: clean
-	-$(RM) $(PROGS)
+	-$(RM) $(PROGS) $(LINTS)
 
 clean:
 
--- old/usr/src/test/util-tests/tests/libsff/libsff_8636_tech.c	Thu Nov 16 16:53:28 2017
+++ new/usr/src/test/util-tests/tests/libsff/libsff_8636_tech.c	Thu Nov 16 16:53:28 2017
@@ -68,7 +68,7 @@
 
 		if ((ret = libsff_parse(buf, sizeof (buf), 0xa0, &nvl)) != 0) {
 			errx(1, "TEST FAILED: failed to parse QSFP device tech "
-			    "%d: %s\n", i, strerror(errno));
+			    "%d: %s\n", i, strerror(ret));
 		}
 
 		lst_print_array(nvl, LIBSFF_KEY_TRAN_TECH);
--- old/usr/src/test/util-tests/tests/libsff/libsff_8636_temp.c	Thu Nov 16 16:53:28 2017
+++ new/usr/src/test/util-tests/tests/libsff/libsff_8636_temp.c	Thu Nov 16 16:53:28 2017
@@ -44,13 +44,13 @@
 		buf[SFF_8636_MAX_CASE_TEMP] = i;
 		if ((ret = libsff_parse(buf, sizeof (buf), 0xa0, &nvl)) != 0) {
 			errx(1, "TEST FAILED: failed to parse QSFP connector "
-			    "%d: %s\n", i, strerror(errno));
+			    "%d: %s\n", i, strerror(ret));
 		}
 
 		if ((ret = nvlist_lookup_string(nvl, LIBSFF_KEY_MAX_CASE_TEMP,
 		    &val)) != 0) {
 			errx(1, "TEST FAILED: failed to find connector when "
-			    "parsing key %d: %s\n", i, strerror(errno));
+			    "parsing key %d: %s\n", i, strerror(ret));
 		}
 
 		(void) puts(val);
--- old/usr/src/test/util-tests/tests/libsff/libsff_efault.c	Thu Nov 16 16:53:28 2017
+++ new/usr/src/test/util-tests/tests/libsff/libsff_efault.c	Thu Nov 16 16:53:28 2017
@@ -28,10 +28,10 @@
 int
 main(void)
 {
-	int ret;
 	void *addr;
 	nvlist_t *nvl;
 	size_t len = getpagesize();
+	int ret;
 
 	/*
 	 * Get an unreadable page
@@ -46,8 +46,8 @@
 	}
 
 	if ((ret = libsff_parse(addr, 128, 0xa0, &nvl)) != EFAULT) {
-		errx(1, "TEST FAILED: failed to return EFAULT on bad"
-		    "data buffer\n");
+		errx(1, "TEST FAILED: failed to return EFAULT on bad "
+		    "data buffer (%s instead)\n", strerror(ret));
 	}
 
 	return (0);
--- old/usr/src/test/util-tests/tests/libsff/libsff_einval.c	Thu Nov 16 16:53:28 2017
+++ new/usr/src/test/util-tests/tests/libsff/libsff_einval.c	Thu Nov 16 16:53:28 2017
@@ -28,9 +28,9 @@
 int
 main(void)
 {
-	int ret;
 	uint8_t buf[256];
 	nvlist_t *nvl;
+	int ret;
 
 	bzero(buf, sizeof (buf));
 	if ((ret = libsff_parse(NULL, sizeof (buf), 0xa0, &nvl)) != EINVAL) {
@@ -38,50 +38,54 @@
 	}
 
 	if ((ret = libsff_parse(buf, sizeof (buf), 0xa0, NULL)) != EINVAL) {
-		errx(1, "TEST FAILED: failed to return EINVAL on NULL nvl");
+		errx(1, "TEST FAILED: failed to return EINVAL on NULL nvl "
+		    "(%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, sizeof (buf), 0xa1, &nvl)) != EINVAL) {
-		errx(1, "TEST FAILED: failed to return EINVAL on bad page");
+		errx(1, "TEST FAILED: failed to return EINVAL on bad page "
+		    "(%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, sizeof (buf), 0, &nvl)) != EINVAL) {
-		errx(1, "TEST FAILED: failed to return EINVAL on bad page");
+		errx(1, "TEST FAILED: failed to return EINVAL on bad page "
+		    "(%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, sizeof (buf), 0xff, &nvl)) != EINVAL) {
-		errx(1, "TEST FAILED: failed to return EINVAL on bad page");
+		errx(1, "TEST FAILED: failed to return EINVAL on bad page "
+		    "(%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, 0, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8476 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, 50, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8476 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	buf[SFF_8472_IDENTIFIER] = SFF_8024_ID_QSFP;
 	if ((ret = libsff_parse(buf, 0, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8476 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, 50, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8476 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, 96, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8635 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	if ((ret = libsff_parse(buf, 128, 0xa0, &nvl)) != EINVAL) {
 		errx(1, "TEST FAILED: failed to return EINVAL on bad 8635 "
-		    "size");
+		    "size (%s instead)", strerror(ret));
 	}
 
 	return (0);
