From owner-svn-src-user@FreeBSD.ORG Fri Jun 27 05:15:54 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55FD417F; Fri, 27 Jun 2014 05:15:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4470A20C8; Fri, 27 Jun 2014 05:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5R5Fs1E050778; Fri, 27 Jun 2014 05:15:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R5Fs4E050777; Fri, 27 Jun 2014 05:15:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406270515.s5R5Fs4E050777@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 27 Jun 2014 05:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r267948 - user/marcel/mkimg X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 05:15:54 -0000 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 = {