Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2014 05:15:54 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r267948 - user/marcel/mkimg
Message-ID:  <201406270515.s5R5Fs4E050777@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 = {



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