diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
commit | cad5364599eb5062d59e0c397ed638ddd61a8d5d (patch) | |
tree | a318d0f03aa076c74b576ea45dc543a5669e8e91 /libbb/full_write.c | |
parent | e01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff) | |
download | busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2 busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip |
Major coreutils update.
Diffstat (limited to 'libbb/full_write.c')
-rw-r--r-- | libbb/full_write.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libbb/full_write.c b/libbb/full_write.c index a2c07fbc9..1106a53b4 100644 --- a/libbb/full_write.c +++ b/libbb/full_write.c | |||
@@ -28,10 +28,10 @@ | |||
28 | * This does multiple writes as necessary. | 28 | * This does multiple writes as necessary. |
29 | * Returns the amount written, or -1 on an error. | 29 | * Returns the amount written, or -1 on an error. |
30 | */ | 30 | */ |
31 | int full_write(int fd, const char *buf, int len) | 31 | ssize_t bb_full_write(int fd, const void *buf, size_t len) |
32 | { | 32 | { |
33 | int cc; | 33 | ssize_t cc; |
34 | int total; | 34 | ssize_t total; |
35 | 35 | ||
36 | total = 0; | 36 | total = 0; |
37 | 37 | ||
@@ -39,10 +39,10 @@ int full_write(int fd, const char *buf, int len) | |||
39 | cc = write(fd, buf, len); | 39 | cc = write(fd, buf, len); |
40 | 40 | ||
41 | if (cc < 0) | 41 | if (cc < 0) |
42 | return -1; | 42 | return cc; /* write() returns -1 on failure. */ |
43 | 43 | ||
44 | buf += cc; | ||
45 | total += cc; | 44 | total += cc; |
45 | buf = ((const char *)buf) + cc; | ||
46 | len -= cc; | 46 | len -= cc; |
47 | } | 47 | } |
48 | 48 | ||