summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-22 22:42:44 +0100
committerVolker Lendecke <vl@samba.org>2008-12-29 13:24:28 +0100
commit86cb14db2b041f6f78b7d5b6afe10d141c0b773d (patch)
tree7eda6a940b4cf7698da9a0939fd916b6813c71e5 /source3
parente4d28dbc040e186f453d77c7c1fb628a6cc2e3d4 (diff)
downloadsamba-86cb14db2b041f6f78b7d5b6afe10d141c0b773d.tar.gz
samba-86cb14db2b041f6f78b7d5b6afe10d141c0b773d.tar.bz2
samba-86cb14db2b041f6f78b7d5b6afe10d141c0b773d.zip
Add code to test write_data_iov a bit
Diffstat (limited to 'source3')
-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);