aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix/unix_efile.c
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2012-01-23 11:03:50 +0100
committerHenrik Nord <[email protected]>2012-01-23 11:03:50 +0100
commitc642b830c849b67fb45319f0e913c6ec933c4361 (patch)
tree68f915b1c54c9566cacb5c1ea3d89539094d2080 /erts/emulator/drivers/unix/unix_efile.c
parent87f506ebc6d0caca687b5cd67a844db2a8f8f7b1 (diff)
parentefe40df70999f798590cdbfd6648375891aa0ab0 (diff)
downloadotp-c642b830c849b67fb45319f0e913c6ec933c4361.tar.gz
otp-c642b830c849b67fb45319f0e913c6ec933c4361.tar.bz2
otp-c642b830c849b67fb45319f0e913c6ec933c4361.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/drivers/unix/unix_efile.c')
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index e7dd9d2bdb..796843a735 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -1406,10 +1406,9 @@ efile_fadvise(Efile_error* errInfo, int fd, Sint64 offset,
}
#ifdef HAVE_SENDFILE
-
// For some reason the maximum size_t cannot be used as the max size
// 3GB seems to work on all platforms
-#define SENDFILE_CHUNK_SIZE ((1 << 30) -1)
+#define SENDFILE_CHUNK_SIZE ((1UL << 30) -1)
/*
* sendfile: The implementation of the sendfile system call varies
@@ -1446,7 +1445,7 @@ efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
written += retval;
*nbytes -= retval;
}
- } while (retval != -1 && retval == SENDFILE_CHUNK_SIZE);
+ } while (retval == SENDFILE_CHUNK_SIZE);
*nbytes = written;
return check_error(retval == -1 ? -1 : 0, errInfo);
#elif defined(__sun) && defined(__SVR4) && defined(HAVE_SENDFILEV)