diff options
author | Denis Vlasenko | 2006-12-22 00:21:07 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-12-22 00:21:07 +0000 |
commit | 714701c890b5f03253c5ecdb7367c4258ce78715 (patch) | |
tree | 7ddaf73cf2deda0f357b21802dab4d42798dd778 /include/libbb.h | |
parent | 0a8a7741795880201bcf78231d1eab0e2538bb0b (diff) | |
download | busybox-714701c890b5f03253c5ecdb7367c4258ce78715.zip busybox-714701c890b5f03253c5ecdb7367c4258ce78715.tar.gz |
tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 2fd54e7..2bfeba4 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -203,8 +203,13 @@ extern int recursive_action(const char *fileName, int recurse, extern int device_open(const char *device, int mode); extern int get_console_fd(void); extern char *find_block_device(char *path); -extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); +/* bb_copyfd_XX print read/write errors and return -1 if they occur */ extern off_t bb_copyfd_eof(int fd1, int fd2); +extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); +extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size); +/* "short" copy can be detected by return value < size */ +/* this helper yells "short read!" if param is not -1 */ +extern void complain_copyfd_and_die(off_t sz) ATTRIBUTE_NORETURN; extern char bb_process_escape_sequence(const char **ptr); extern char *bb_get_last_path_component(char *path); extern int ndelay_on(int fd); |