svn commit: r267948 - user/marcel/mkimg
Marcel Moolenaar
marcel at FreeBSD.org
Fri Jun 27 05:15:54 UTC 2014
Author: marcel
Date: Fri Jun 27 05:15:53 2014
New Revision: 267948
URL: http://svnweb.freebsd.org/changeset/base/267948
Log:
Previous commit was premature in stating that we could test. The
file must have the footer at the end and we didn't write it yet.
With this commit we actually write the footer.
Let the testing begin.
Modified:
user/marcel/mkimg/vhd.c
Modified: user/marcel/mkimg/vhd.c
==============================================================================
--- user/marcel/mkimg/vhd.c Fri Jun 27 05:04:36 2014 (r267947)
+++ user/marcel/mkimg/vhd.c Fri Jun 27 05:15:53 2014 (r267948)
@@ -171,7 +171,7 @@ vhd_write(int fd)
void *bitmap;
size_t batsz;
uint32_t sector;
- int entry, bat_entries;
+ int bat_entries, error, entry;
imgsz = image_get_size() * secsz;
bat_entries = imgsz / VHD_BLOCK_SIZE;
@@ -233,7 +233,14 @@ vhd_write(int fd)
}
free(bitmap);
- return (image_copyout(fd));
+ error = image_copyout(fd);
+ if (error)
+ return (error);
+
+ if (sparse_write(fd, &footer, sizeof(footer)) < 0)
+ return (errno);
+
+ return (0);
}
static struct mkimg_format vhd_format = {
More information about the svn-src-user
mailing list