aboutsummaryrefslogtreecommitdiff
path: root/libbb/full_write.c
diff options
context:
space:
mode:
authormjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
committermjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
commite901c15d890dbbdce4c086963cb1513653fc46b5 (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /libbb/full_write.c
parent40758c00616c3b2c85d83eb4afdeb04b1f65c9f1 (diff)
downloadbusybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.gz
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.bz2
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.zip
Major coreutils update.
git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb/full_write.c')
-rw-r--r--libbb/full_write.c10
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 */
31int full_write(int fd, const char *buf, int len) 31ssize_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