From: BJ Hargrave Date: Sun, 11 Sep 2011 16:20:06 GMT Subject: Re: [PATCH] Support empty blob in fsck --lost-found Message-ID: In-Reply-To: On Sep 11, 2011, at 12:03 , Sverre Rabbelier wrote: > Heya, > > On Sun, Sep 11, 2011 at 17:40, BJ Hargrave wrote: >> fsck --lost-found died when attempting to write out the empty blob. >> Avoid calling fwrite when the blob size is zero since the call to >> fwrite returns 0 objects written which fails the check and caused >> fsck to die. > > Now we don't die at all if a 0-byte file couldn't be written. > Shouldn't we check errno or something? > You don't need to write anything to the 0-byte file. Just create it and close it and there are checks already that verify the fopen and fclose do not fail. So I don't think we are missing any error conditions here. > -- > Cheers, > > Sverre Rabbelier -- BJ Hargrave