summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-05 23:07:25 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-05 23:07:25 +0000
commit83f173b61ec4df708d6ead45540ede3a28c2e630 (patch)
treec1986321291c7ac619748f051f3d716bc89f46da
parentc270ec1fa27e998d6d22bb43c3839789f8af4ba8 (diff)
downloadbusybox-w32-83f173b61ec4df708d6ead45540ede3a28c2e630.tar.gz
busybox-w32-83f173b61ec4df708d6ead45540ede3a28c2e630.tar.bz2
busybox-w32-83f173b61ec4df708d6ead45540ede3a28c2e630.zip
A first pass at making D_FILE_OFFSET_BITS=64 work, from
Jari Ruusu <jari.ruusu@pp.inet.fi>
-rw-r--r--ar.c6
-rw-r--r--archival/ar.c6
-rw-r--r--libbb/copy_file_chunk.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/ar.c b/ar.c
index 59f51815f..d66671900 100644
--- a/ar.c
+++ b/ar.c
@@ -31,7 +31,7 @@
31 31
32typedef struct ar_headers_s { 32typedef struct ar_headers_s {
33 char *name; 33 char *name;
34 size_t size; 34 off_t size;
35 uid_t uid; 35 uid_t uid;
36 gid_t gid; 36 gid_t gid;
37 mode_t mode; 37 mode_t mode;
@@ -90,7 +90,7 @@ extern ar_headers_t get_ar_headers(int srcFd)
90 /* dont worry about adding the last '\n', we dont need it now */ 90 /* dont worry about adding the last '\n', we dont need it now */
91 } 91 }
92 92
93 entry->size = (size_t) atoi(raw_ar_header.size); 93 entry->size = (off_t) atoi(raw_ar_header.size);
94 /* long filenames have '/' as the first character */ 94 /* long filenames have '/' as the first character */
95 if (raw_ar_header.name[0] == '/') { 95 if (raw_ar_header.name[0] == '/') {
96 if (raw_ar_header.name[1] == '/') { 96 if (raw_ar_header.name[1] == '/') {
@@ -211,7 +211,7 @@ extern int ar_main(int argc, char **argv)
211 } 211 }
212 if ((funct & extract_to_file) || (funct & extract_to_stdout)) { 212 if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
213 lseek(srcFd, extract_list->offset, SEEK_SET); 213 lseek(srcFd, extract_list->offset, SEEK_SET);
214 copy_file_chunk(srcFd, dstFd, (size_t) extract_list->size); 214 copy_file_chunk(srcFd, dstFd, (off_t) extract_list->size);
215 } 215 }
216 if (funct & verbose) { 216 if (funct & verbose) {
217 printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), 217 printf("%s %d/%d %8d %s ", mode_string(extract_list->mode),
diff --git a/archival/ar.c b/archival/ar.c
index 59f51815f..d66671900 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -31,7 +31,7 @@
31 31
32typedef struct ar_headers_s { 32typedef struct ar_headers_s {
33 char *name; 33 char *name;
34 size_t size; 34 off_t size;
35 uid_t uid; 35 uid_t uid;
36 gid_t gid; 36 gid_t gid;
37 mode_t mode; 37 mode_t mode;
@@ -90,7 +90,7 @@ extern ar_headers_t get_ar_headers(int srcFd)
90 /* dont worry about adding the last '\n', we dont need it now */ 90 /* dont worry about adding the last '\n', we dont need it now */
91 } 91 }
92 92
93 entry->size = (size_t) atoi(raw_ar_header.size); 93 entry->size = (off_t) atoi(raw_ar_header.size);
94 /* long filenames have '/' as the first character */ 94 /* long filenames have '/' as the first character */
95 if (raw_ar_header.name[0] == '/') { 95 if (raw_ar_header.name[0] == '/') {
96 if (raw_ar_header.name[1] == '/') { 96 if (raw_ar_header.name[1] == '/') {
@@ -211,7 +211,7 @@ extern int ar_main(int argc, char **argv)
211 } 211 }
212 if ((funct & extract_to_file) || (funct & extract_to_stdout)) { 212 if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
213 lseek(srcFd, extract_list->offset, SEEK_SET); 213 lseek(srcFd, extract_list->offset, SEEK_SET);
214 copy_file_chunk(srcFd, dstFd, (size_t) extract_list->size); 214 copy_file_chunk(srcFd, dstFd, (off_t) extract_list->size);
215 } 215 }
216 if (funct & verbose) { 216 if (funct & verbose) {
217 printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), 217 printf("%s %d/%d %8d %s ", mode_string(extract_list->mode),
diff --git a/libbb/copy_file_chunk.c b/libbb/copy_file_chunk.c
index 3c657dd06..bf0b06e1a 100644
--- a/libbb/copy_file_chunk.c
+++ b/libbb/copy_file_chunk.c
@@ -32,9 +32,9 @@
32/* 32/*
33 * Copy chunksize bytes between two file descriptors 33 * Copy chunksize bytes between two file descriptors
34 */ 34 */
35int copy_file_chunk(int srcfd, int dstfd, size_t chunksize) 35int copy_file_chunk(int srcfd, int dstfd, off_t chunksize)
36{ 36{
37 size_t size; 37 off_t size;
38 char buffer[BUFSIZ]; /* BUFSIZ is declared in stdio.h */ 38 char buffer[BUFSIZ]; /* BUFSIZ is declared in stdio.h */
39 39
40 while (chunksize > 0) { 40 while (chunksize > 0) {