Re: [PATCH v6 02/39] api-lockfile: revise and expand the documentation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 26, 2014, 20:40 UTC
- Message-ID
- <xmqq8ul6869o.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1411726119-31598-3-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> +If you need to close the file descriptor you obtained from a > +`hold_lock_file_*` function yourself, do so by calling > +`close_lock_file`. You should never call `close(2)` yourself!
This is sometimes untenable, isn't it? A caller may want to freopen(3) a stream on the fd to write into it and then fclose(3); which would not know to call close_lock_file() but calls close(2).