summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index d52d12bf72..ed66666ddb 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -149,6 +149,17 @@ ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt)
{
ssize_t ret;
+#if 0
+ /* Try to confuse write_data_iov a bit */
+ if ((random() % 5) == 0) {
+ return sys_write(fd, iov[0].iov_base, iov[0].iov_len);
+ }
+ if (iov[0].iov_len > 1) {
+ return sys_write(fd, iov[0].iov_base,
+ (random() % (iov[0].iov_len-1)) + 1);
+ }
+#endif
+
do {
ret = writev(fd, iov, iovcnt);
} while (ret == -1 && errno == EINTR);