Thread (1 message) 1 message, 1 author, 2024-09-05

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

From: Junio C Hamano <hidden>
Date: 2024-09-05 15:16:11

Jeff King [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help