Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2014 14:37:36 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r266129 - user/marcel/mkimg
Message-ID:  <201405151437.s4FEbaJT023489@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Thu May 15 14:37:35 2014
New Revision: 266129
URL: http://svnweb.freebsd.org/changeset/base/266129

Log:
  Give sparse_write() the same prototype as write(2) as it's supposed to
  be a drop-in replacement.

Modified:
  user/marcel/mkimg/mkimg.c
  user/marcel/mkimg/mkimg.h

Modified: user/marcel/mkimg/mkimg.c
==============================================================================
--- user/marcel/mkimg/mkimg.c	Thu May 15 14:26:11 2014	(r266128)
+++ user/marcel/mkimg/mkimg.c	Thu May 15 14:37:35 2014	(r266129)
@@ -218,13 +218,14 @@ parse_part(const char *spec)
 
 #if defined(SPARSE_WRITE)
 ssize_t
-sparse_write(int fd, const char *buf, size_t sz)
+sparse_write(int fd, const void *ptr, size_t sz)
 {
-	const char *p;
+	const char *buf, *p;
 	off_t ofs;
 	size_t len;
 	ssize_t wr, wrsz;
 
+	buf = ptr;
 	wrsz = 0;
 	p = memchr(buf, 0, sz);
 	while (sz > 0) {

Modified: user/marcel/mkimg/mkimg.h
==============================================================================
--- user/marcel/mkimg/mkimg.h	Thu May 15 14:26:11 2014	(r266128)
+++ user/marcel/mkimg/mkimg.h	Thu May 15 14:37:35 2014	(r266129)
@@ -68,7 +68,7 @@ round_block(lba_t n)
 #if !defined(SPARSE_WRITE)
 #define	sparse_write	write
 #else
-ssize_t sparse_write(int, const char *, size_t);
+ssize_t sparse_write(int, const void *, size_t);
 #endif
 
 #endif /* _MKIMG_MKIMG_H_ */



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