diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-10 15:24:26 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-10 15:24:26 -0800 |
commit | 02d0457eb4b9bf656965c5dbb613b8bfaef3316f (patch) | |
tree | 1cec6b47aa64274a4c154a00fefdf5c3d0bcfecc /cache.h | |
parent | e484bcbab1398e9a716e2e0e9de7928d9f796ef2 (diff) | |
parent | b4d065df03049bacfbc40467b60b13e804b7d289 (diff) | |
download | git-02d0457eb4b9bf656965c5dbb613b8bfaef3316f.tar.gz |
Merge branch 'jc/git-open-cloexec'
The codeflow of setting NOATIME and CLOEXEC on file descriptors Git
opens has been simplified.
We may want to drop the tip one, but we'll see.
* jc/git-open-cloexec:
sha1_file: stop opening files with O_NOATIME
git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
git_open(): untangle possible NOATIME and CLOEXEC interactions
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1125,7 +1125,8 @@ extern int write_sha1_file(const void *buf, unsigned long len, const char *type, extern int hash_sha1_file_literally(const void *buf, unsigned long len, const char *type, unsigned char *sha1, unsigned flags); extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *); extern int force_object_loose(const unsigned char *sha1, time_t mtime); -extern int git_open(const char *name); +extern int git_open_cloexec(const char *name, int flags); +#define git_open(name) git_open_cloexec(name, O_RDONLY) extern void *map_sha1_file(const unsigned char *sha1, unsigned long *size); extern int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz); extern int parse_sha1_header(const char *hdr, unsigned long *sizep); |