Re: [PATCH] sparse-checkout: use fdopen_lock_file() instead of xfdopen()

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

 



Jeff King <peff@xxxxxxxx> writes:

> We do have to adjust the code a bit:
>
>   - we have to handle errors ourselves; we can just die(), since that's
>     what xfdopen() would have done (and we can even provide a more
>     specific error message).
>
>   - we no longer need to call fflush(); committing the lock-file
>     auto-closes it, which will now do the flush for us. As a bonus, this
>     will actually check that the flush was successful before renaming
>     the file into place. Let's likewise report when committing the lock
>     fails (rather than quietly returning success from the command).
>
>   - we can get rid of the local "fd" variable, since we never look at it
>     ourselves now

OK.  The neessary change is surprisingly small.

> I found this because I was building git on an Android system,...

Sounds like fun.

Will queue.  Thanks.




[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