Re: [PATCH] bundle, fast-import: detect write failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote:
> Are you aware what this code does?  It writes a ".keep" file.  Whose
> purpose is to _exist_, and whose purpose is fulfilled, even if the write
> or the push-back did not succeed.

Hi,

I do see what you mean.

If the write is not necessary, then perhaps you would prefer a comment
documenting that failures of the write and following close are ignorable.
And add a '(void)' stmt prefix, to tell compilers that ignoring the
return value is deliberate.

However, even if it's not technically required to fail at that point,
if it were my choice, I'd prefer to know when a .keep file whose
contents are unimportant just happens to reside on a bad spot on my
disk.  I/O errors should never be ignored.

> I could not care less what the manual says.  What is important is if the
> defensive programming is done mindlessly, and therefore can fail so not
> gracefully.

On the other hand, if that write failure is truly ignorable,
a mindless minimalist :-) might argue that it's best just to
omit the syscall.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux