external/busybox
Revision | f72d270ac9eaa45f026a702ac9075e52656d0c28 (tree) |
---|---|
Time | 2015-03-12 02:13:15 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
xlseek: large file support
This fixes the issue that mke2fs can't format large disks.
@@ -505,7 +505,7 @@ int open_or_warn_stdin(const char *pathname) FAST_FUNC; | ||
505 | 505 | int xopen_stdin(const char *pathname) FAST_FUNC; |
506 | 506 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; |
507 | 507 | int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC; |
508 | -off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC; | |
508 | +off64_t xlseek(int fd, off64_t offset, int whence) FAST_FUNC; | |
509 | 509 | int xmkstemp(char *template) FAST_FUNC; |
510 | 510 | off_t fdlength(int fd) FAST_FUNC; |
511 | 511 |
@@ -246,12 +246,12 @@ void FAST_FUNC xclose(int fd) | ||
246 | 246 | } |
247 | 247 | |
248 | 248 | // Die with an error message if we can't lseek to the right spot. |
249 | -off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) | |
249 | +off64_t FAST_FUNC xlseek(int fd, off64_t offset, int whence) | |
250 | 250 | { |
251 | - off_t off = lseek(fd, offset, whence); | |
251 | + off64_t off = lseek64(fd, offset, whence); | |
252 | 252 | if (off == (off_t)-1) { |
253 | 253 | if (whence == SEEK_SET) |
254 | - bb_perror_msg_and_die("lseek(%"OFF_FMT"u)", offset); | |
254 | + bb_perror_msg_and_die("lseek(%llu)", offset); | |
255 | 255 | bb_perror_msg_and_die("lseek"); |
256 | 256 | } |
257 | 257 | return off; |