Date: Thu, 8 May 2014 00:08:19 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r265623 - user/marcel/mkimg Message-ID: <201405080008.s4808JWt066703@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Thu May 8 00:08:19 2014 New Revision: 265623 URL: http://svnweb.freebsd.org/changeset/base/265623 Log: When write sparse files, make sure to truncate(2) the file. Otherwise any hole at the end is lost and the file is not of the right size. Modified: user/marcel/mkimg/image.c Modified: user/marcel/mkimg/image.c ============================================================================== --- user/marcel/mkimg/image.c Wed May 7 23:50:44 2014 (r265622) +++ user/marcel/mkimg/image.c Thu May 8 00:08:19 2014 (r265623) @@ -118,6 +118,8 @@ image_copyout(int fd) } } free(buffer); + ofs = lseek(fd, 0L, SEEK_CUR); + ftruncate(fd, ofs); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405080008.s4808JWt066703>