repo.or.cz
/
git
/
mingw.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'rh/merge-options-doc-fix' into maint
[git/mingw.git]
/
compat
/
clipped-write.c
blob
b8f98ff77f7547ba99f23995c4fe62c4cbc7584c
1
#include
"../git-compat-util.h"
2
#undef write
3
4
/*
5
* Version of write that will write at most INT_MAX bytes.
6
* Workaround a xnu bug on Mac OS X
7
*/
8
ssize_t
clipped_write
(
int
fildes
,
const void
*
buf
,
size_t
nbyte
)
9
{
10
if
(
nbyte
>
INT_MAX
)
11
nbyte
=
INT_MAX
;
12
return
write
(
fildes
,
buf
,
nbyte
);
13
}