diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index f7376ce74fe..b141f568d70 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2125,7 +2125,8 @@ permissions. */) | |||
| 2125 | /* Copy at most COPY_MAX bytes at a time; this is min | 2125 | /* Copy at most COPY_MAX bytes at a time; this is min |
| 2126 | (PTRDIFF_MAX, SIZE_MAX) truncated to a value that is | 2126 | (PTRDIFF_MAX, SIZE_MAX) truncated to a value that is |
| 2127 | surely aligned well. */ | 2127 | surely aligned well. */ |
| 2128 | ptrdiff_t copy_max = min (PTRDIFF_MAX, SIZE_MAX) >> 30 << 30; | 2128 | ssize_t ssize_max = TYPE_MAXIMUM (ssize_t); |
| 2129 | ptrdiff_t copy_max = min (ssize_max, SIZE_MAX) >> 30 << 30; | ||
| 2129 | off_t intail = insize - newsize; | 2130 | off_t intail = insize - newsize; |
| 2130 | ptrdiff_t len = min (intail, copy_max); | 2131 | ptrdiff_t len = min (intail, copy_max); |
| 2131 | copied = copy_file_range (ifd, NULL, ofd, NULL, len, 0); | 2132 | copied = copy_file_range (ifd, NULL, ofd, NULL, len, 0); |