From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: [PATCH v4 2/2] efi: an sysfs interface for user to update efi firmware Date: Tue, 21 Apr 2015 19:20:28 -0700 Message-ID: <1429669228.2207.46.camel@HansenPartnership.com> References: <1429004697-28320-3-git-send-email-hock.leong.kweh@intel.com> <20150414140914.GE5989@kroah.com> <20150415131906.GC21491@kroah.com> <20150417134924.GB19794@kroah.com> <20150417143640.GB3671@codeblueprint.co.uk> <20150420144323.GA7261@kroah.com> <20150421075620.GA11000@kroah.com> <1429665679.2207.44.camel@HansenPartnership.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Greg Kroah-Hartman , "Kweh, Hock Leong" , Matt Fleming , Ming Lei , "Ong, Boon Leong" , LKML , "linux-efi@vger.kernel.org" List-Id: linux-efi@vger.kernel.org On Tue, 2015-04-21 at 18:58 -0700, Andy Lutomirski wrote: > On Tue, Apr 21, 2015 at 6:21 PM, James Bottomley > wrote: > > Andy, just on the misc device idea, what about triggering the capsule > > update from close()? In theory close returns an error code (not sure if > > most tools actually check this, though). That means we can do the write > > in chunks but pass it in atomically on the close and cat will work > > (provided it checks the return code of close). > > I thought about this but IIRC cat doesn't check the return value from close. It does in my copy (coreutils-8.23) : if (!STREQ (infile, "-") && close (input_desc) < 0) { error (0, errno, "%s", infile); ok = false; } [...] if (have_read_stdin && close (STDIN_FILENO) < 0) error (EXIT_FAILURE, errno, _("closing standard input")); James