Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jul 2017 02:19:49 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320522 - head/sbin/nvmecontrol
Message-ID:  <201707010219.v612JnCm047873@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Jul  1 02:19:48 2017
New Revision: 320522
URL: https://svnweb.freebsd.org/changeset/base/320522

Log:
  Fix sign of resid and add a mostly useless cast to cope with signed vs
  unsigned check warnings from traditional unix code construsts bogusly
  flagged as potentially unsafe.

Modified:
  head/sbin/nvmecontrol/wdc.c

Modified: head/sbin/nvmecontrol/wdc.c
==============================================================================
--- head/sbin/nvmecontrol/wdc.c	Fri Jun 30 23:53:40 2017	(r320521)
+++ head/sbin/nvmecontrol/wdc.c	Sat Jul  1 02:19:48 2017	(r320522)
@@ -105,7 +105,7 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, ui
 	int fd2;
 	uint8_t *buf;
 	uint32_t len, offset;
-	ssize_t resid;
+	size_t resid;
 
 	wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix);
 
@@ -142,7 +142,7 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, ui
 				resid = len;
 			first = 0;
 		}
-		if (write(fd2, buf, resid) != resid)
+		if (write(fd2, buf, resid) != (ssize_t)resid)
 			err(1, "write");
 		offset += resid;
 		len -= resid;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707010219.v612JnCm047873>