summaryrefslogtreecommitdiff
path: root/libbb/full_write.c
diff options
context:
space:
mode:
authorDenys Vlasenko2019-05-14 17:46:18 +0200
committerDenys Vlasenko2019-05-14 17:49:14 +0200
commit875ce094cf2d421ba05bed6cfd6c948084d52abe (patch)
tree90bff2304d2bb604d170a16715e924b2a6947597 /libbb/full_write.c
parent8c317f03f6d4d89fd7b0cc1e6eaf515040b8e701 (diff)
downloadbusybox-875ce094cf2d421ba05bed6cfd6c948084d52abe.zip
busybox-875ce094cf2d421ba05bed6cfd6c948084d52abe.tar.gz
dd: fix handling of short result of full_write(), closes 11711
$ dd bs=1G <sda1 of=/dev/sda1 dd: error writing '/dev/sda1': No space left on device 1+0 records in 0+0 records out 999292928 bytes (953.0MB) copied, 0.784617 seconds, 1.2GB/s function old new delta write_and_stats 99 102 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/full_write.c')
-rw-r--r--libbb/full_write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/full_write.c b/libbb/full_write.c
index 2b7983f..15766fc 100644
--- a/libbb/full_write.c
+++ b/libbb/full_write.c
@@ -11,7 +11,8 @@
/*
* Write all of the supplied buffer out to a file.
* This does multiple writes as necessary.
- * Returns the amount written, or -1 on an error.
+ * Returns the amount written, or -1 if error was seen
+ * on the very first write.
*/
ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
{