summaryrefslogtreecommitdiff
path: root/tests/diff/parse.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-02-22 20:10:52 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-02-22 20:10:52 +0000
commitbd132046b04875f928e52d16363fb73f8e85dded (patch)
treeed89c4f13e9e7134906c52a3620cce2ef9e782d6 /tests/diff/parse.c
parent0345a380a090d28c8435f09f2f35085b435229d9 (diff)
downloadlibgit2-bd132046b04875f928e52d16363fb73f8e85dded.tar.gz
p_fallocate: compatibility fixes for macOS
On macOS, fcntl(..., F_PREALLOCATE, ...) will only succeed when followed by an ftruncate(), even when it reports success. However, that syscall will fail when the file already exists. Thus, we must ignore the error code and simply let ftruncate extend the size of the file itself (albeit slowly). By calling ftruncate, we also need to prevent against file shrinkage, for compatibility with posix_ftruncate, which will only extend files, never shrink them.
Diffstat (limited to 'tests/diff/parse.c')
0 files changed, 0 insertions, 0 deletions