Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177849070
D11715.1795426262.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
675 B
Referenced Files
None
Subscribers
None
D11715.1795426262.diff
View Options
Index: head/usr.bin/ar/write.c
===================================================================
--- head/usr.bin/ar/write.c
+++ head/usr.bin/ar/write.c
@@ -586,10 +586,17 @@
static void
write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s)
{
+ ssize_t written;
+
prefault_buffer(buf, s);
- if (archive_write_data(a, buf, s) != (ssize_t)s)
- bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s",
- archive_error_string(a));
+ while (s > 0) {
+ written = archive_write_data(a, buf, s);
+ if (written < 0)
+ bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s",
+ archive_error_string(a));
+ buf = (const char *)buf + written;
+ s -= written;
+ }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 9:31 AM (12 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41927116
Default Alt Text
D11715.1795426262.diff (675 B)
Attached To
Mode
D11715: ar: handle partial writes from archive_write_data
Attached
Detach File
Event Timeline