From owner-svn-src-user@FreeBSD.ORG Thu May 8 21:12:40 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 621DA252; Thu, 8 May 2014 21:12:40 +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 35F63641; Thu, 8 May 2014 21:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48LCeIf006716; Thu, 8 May 2014 21:12:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48LCdCb006682; Thu, 8 May 2014 21:12:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405082112.s48LCdCb006682@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 8 May 2014 21:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r265718 - 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: Thu, 08 May 2014 21:12:40 -0000 Author: marcel Date: Thu May 8 21:12:39 2014 New Revision: 265718 URL: http://svnweb.freebsd.org/changeset/base/265718 Log: Add format_write() that calls the write() function of the output format. Have the raw format use image_copyout() for now. Modified: user/marcel/mkimg/format.c user/marcel/mkimg/format.h user/marcel/mkimg/mkimg.c user/marcel/mkimg/raw.c Modified: user/marcel/mkimg/format.c ============================================================================== --- user/marcel/mkimg/format.c Thu May 8 21:03:31 2014 (r265717) +++ user/marcel/mkimg/format.c Thu May 8 21:12:39 2014 (r265718) @@ -65,3 +65,13 @@ format_selected(void) return (format); } + +int +format_write(int fd) +{ + + if (format == NULL) + return (ENOSYS); + + return (format->write(fd)); +} Modified: user/marcel/mkimg/format.h ============================================================================== --- user/marcel/mkimg/format.h Thu May 8 21:03:31 2014 (r265717) +++ user/marcel/mkimg/format.h Thu May 8 21:12:39 2014 (r265718) @@ -42,5 +42,6 @@ SET_DECLARE(formats, struct mkimg_format int format_select(const char *); struct mkimg_format *format_selected(void); +int format_write(int); #endif /* _MKIMG_FORMAT_H_ */ Modified: user/marcel/mkimg/mkimg.c ============================================================================== --- user/marcel/mkimg/mkimg.c Thu May 8 21:03:31 2014 (r265717) +++ user/marcel/mkimg/mkimg.c Thu May 8 21:12:39 2014 (r265718) @@ -451,7 +451,7 @@ main(int argc, char *argv[]) fprintf(stderr, "Number of cylinders: %u\n", ncyls); } - error = image_copyout(outfd); + error = format_write(outfd); if (error) errc(EX_IOERR, error, "writing image"); Modified: user/marcel/mkimg/raw.c ============================================================================== --- user/marcel/mkimg/raw.c Thu May 8 21:03:31 2014 (r265717) +++ user/marcel/mkimg/raw.c Thu May 8 21:12:39 2014 (r265718) @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" static int -raw_write(int fd __unused) +raw_write(int fd) { - return (ENOSYS); + return (image_copyout(fd)); } static struct mkimg_format raw_format = {