freebsd-ports/devel/git/files/patch-wrapper.c
Wesley Shields bf1ec2cf29 Update to 1.7.0.5
Rework manpages so it's harder to miss when new ones are added
General cleanup of Makefile
[1]: Fix a bug when trying to read/write a 2GB+ file
[2]: Properly daemonize git-daemon

Submitted by:	[1]: Artem Belevich (private mail)
		[2]: ed@ (private mail)
2010-04-21 01:24:05 +00:00

20 lines
517 B
C

--- wrapper.c.orig 2010-04-17 10:41:51.454820281 -0400
+++ wrapper.c 2010-04-17 11:00:32.542693956 -0400
@@ -117,7 +117,7 @@
{
ssize_t nr;
while (1) {
- nr = read(fd, buf, len);
+ nr = read(fd, buf, MIN(INT_MAX, len));
if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
continue;
return nr;
@@ -133,7 +133,7 @@
{
ssize_t nr;
while (1) {
- nr = write(fd, buf, len);
+ nr = write(fd, buf, MIN(INT_MAX, len));
if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
continue;
return nr;