From owner-svn-src-all@FreeBSD.ORG Sun Jun 21 01:35:33 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE72E70E; Sun, 21 Jun 2015 01:35:33 +0000 (UTC) (envelope-from marcel@FreeBSD.org) 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 ACAF63C6; Sun, 21 Jun 2015 01:35:33 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5L1ZXva001935; Sun, 21 Jun 2015 01:35:33 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5L1ZXuV001933; Sun, 21 Jun 2015 01:35:33 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506210135.t5L1ZXuV001933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 21 Jun 2015 01:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284655 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2015 01:35:33 -0000 Author: marcel Date: Sun Jun 21 01:35:32 2015 New Revision: 284655 URL: https://svnweb.freebsd.org/changeset/base/284655 Log: Don't resize again prior to writing. Resizing may not be idempotent and no scheme adjusts the size after the format resized the image the first time. Modified: head/usr.bin/mkimg/format.c Modified: head/usr.bin/mkimg/format.c ============================================================================== --- head/usr.bin/mkimg/format.c Sun Jun 21 01:22:35 2015 (r284654) +++ head/usr.bin/mkimg/format.c Sun Jun 21 01:35:32 2015 (r284655) @@ -78,14 +78,10 @@ format_selected(void) int format_write(int fd) { - lba_t size; int error; if (format == NULL) return (ENOSYS); - size = image_get_size(); - error = format->resize(size); - if (!error) - error = format->write(fd); + error = format->write(fd); return (error); }