svn commit: r274634 - stable/10/usr.bin/mkimg
Marcel Moolenaar
marcel at FreeBSD.org
Mon Nov 17 17:17:11 UTC 2014
Author: marcel
Date: Mon Nov 17 17:17:10 2014
New Revision: 274634
URL: https://svnweb.freebsd.org/changeset/base/274634
Log:
MFC r274410: Fix for behaviour of SEEK_DATA on ZFS.
Modified:
stable/10/usr.bin/mkimg/image.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.bin/mkimg/image.c
==============================================================================
--- stable/10/usr.bin/mkimg/image.c Mon Nov 17 16:30:51 2014 (r274633)
+++ stable/10/usr.bin/mkimg/image.c Mon Nov 17 17:17:10 2014 (r274634)
@@ -405,16 +405,18 @@ image_copyin_mapped(lba_t blk, int fd, u
error = 0;
while (!error && cur < end) {
hole = lseek(fd, cur, SEEK_HOLE);
+ if (hole == -1)
+ hole = end;
data = lseek(fd, cur, SEEK_DATA);
+ if (data == -1)
+ data = end;
/*
* Treat the entire file as data if sparse files
* are not supported by the underlying file system.
*/
- if (hole == -1 && data == -1) {
+ if (hole == end && data == end)
data = cur;
- hole = end;
- }
if (cur == hole && data > hole) {
hole = pos;
More information about the svn-src-stable-10
mailing list