diff options
author | Glenn L McGrath | 2001-04-12 13:47:12 +0000 |
---|---|---|
committer | Glenn L McGrath | 2001-04-12 13:47:12 +0000 |
commit | c9cac5be236475e91af1865a2dae2c2af5f19fd6 (patch) | |
tree | 833220c0e3e5fda94f60b9c4ce22a965a341c172 | |
parent | 6785b51280d6b0c00e964e1e9b24ff05d92f5bcc (diff) | |
download | busybox-c9cac5be236475e91af1865a2dae2c2af5f19fd6.zip busybox-c9cac5be236475e91af1865a2dae2c2af5f19fd6.tar.gz |
Change size to unsinged long long, so if -1 is passed it will read as much as possible.
-rw-r--r-- | include/libbb.h | 7 | ||||
-rw-r--r-- | libbb/copy_file_chunk.c | 5 | ||||
-rw-r--r-- | libbb/libbb.h | 7 |
3 files changed, 12 insertions, 7 deletions
diff --git a/include/libbb.h b/include/libbb.h index 46a0682..ec2a3a8 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -95,7 +95,7 @@ void reset_ino_dev_hashtable(void); int copy_file(const char *src_name, const char *dst_name, int set_modes, int follow_links, int force_flag, int quiet_flag); -int copy_file_chunk(FILE *src_file, FILE *dst_file, off_t chunksize); +int copy_file_chunk(FILE *src_file, FILE *dst_file, unsigned long long chunksize); char *buildName(const char *dirName, const char *fileName); int makeString(int argc, const char **argv, char *buf, int bufLen); char *getChunk(int size); @@ -234,10 +234,11 @@ typedef enum extract_function_e { extract_info = 4, extract_extract = 8, extract_verbose_extract = 16, - extract_list = 32 + extract_list = 32, + extract_fsys_tarfile = 64 } extract_function_t; extern int deb_extract(const char *package_filename, int function, char *target_dir); -extern int untar(FILE *src_tar_file, int function, char *base_path); +extern int untar(FILE *src_tar_file, int untar_function, char *base_path); extern int unzip(FILE *l_in_file, FILE *l_out_file); extern void gz_close(int gunzip_pid); diff --git a/libbb/copy_file_chunk.c b/libbb/copy_file_chunk.c index 90b6b82..e9663c3 100644 --- a/libbb/copy_file_chunk.c +++ b/libbb/copy_file_chunk.c @@ -31,8 +31,11 @@ /* * Copy chunksize bytes between two file descriptors + * + * unsigned long is used so that if -1 is passed as chunksize it will read as + * much as possible, and it will work with off_t or off64_t */ -extern int copy_file_chunk(FILE *src_file, FILE *dst_file, off_t chunksize) +extern int copy_file_chunk(FILE *src_file, FILE *dst_file, unsigned long long chunksize) { off_t size, amount_written; char buffer[BUFSIZ]; /* BUFSIZ is declared in stdio.h */ diff --git a/libbb/libbb.h b/libbb/libbb.h index 46a0682..ec2a3a8 100644 --- a/libbb/libbb.h +++ b/libbb/libbb.h @@ -95,7 +95,7 @@ void reset_ino_dev_hashtable(void); int copy_file(const char *src_name, const char *dst_name, int set_modes, int follow_links, int force_flag, int quiet_flag); -int copy_file_chunk(FILE *src_file, FILE *dst_file, off_t chunksize); +int copy_file_chunk(FILE *src_file, FILE *dst_file, unsigned long long chunksize); char *buildName(const char *dirName, const char *fileName); int makeString(int argc, const char **argv, char *buf, int bufLen); char *getChunk(int size); @@ -234,10 +234,11 @@ typedef enum extract_function_e { extract_info = 4, extract_extract = 8, extract_verbose_extract = 16, - extract_list = 32 + extract_list = 32, + extract_fsys_tarfile = 64 } extract_function_t; extern int deb_extract(const char *package_filename, int function, char *target_dir); -extern int untar(FILE *src_tar_file, int function, char *base_path); +extern int untar(FILE *src_tar_file, int untar_function, char *base_path); extern int unzip(FILE *l_in_file, FILE *l_out_file); extern void gz_close(int gunzip_pid); |