diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-15 11:38:16 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-15 08:24:35 -0700 |
| commit | 97dc141fd676e7079c2fd51e3bea2681a5b9f824 (patch) | |
| tree | fb8a738d18be7814be0ed6dc2ad07e4e84d3cbfc /object-file.h | |
| parent | object-file: move `safe_create_leading_directories()` into "path.c" (diff) | |
| download | git-97dc141fd676e7079c2fd51e3bea2681a5b9f824.tar.gz git-97dc141fd676e7079c2fd51e3bea2681a5b9f824.zip | |
object-file: move `git_open_cloexec()` to "compat/open.c"
The `git_open_cloexec()` wrapper function provides the ability to open a
file with `O_CLOEXEC` in a platform-agnostic way. This function is
provided by "object-file.c" even though it is not specific to the object
subsystem at all.
Move the file into "compat/open.c". This file already exists before this
commit, but has only been compiled conditionally depending on whether or
not open(3p) may return EINTR. With this change we now unconditionally
compile the object, but wrap `git_open_with_retry()` in an ifdef.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-file.h')
| -rw-r--r-- | object-file.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/object-file.h b/object-file.h index 922f2bba8c..353d8a85c3 100644 --- a/object-file.h +++ b/object-file.h @@ -21,9 +21,6 @@ extern int fetch_if_missing; int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags); int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags); -int git_open_cloexec(const char *name, int flags); -#define git_open(name) git_open_cloexec(name, O_RDONLY) - /** * unpack_loose_header() initializes the data stream needed to unpack * a loose object header. |
