git.samba.org
/
obnox
/
samba-ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75b5b7b
)
Add code to test write_data_iov a bit
author
Volker Lendecke
<vl@samba.org>
Mon, 22 Dec 2008 21:42:44 +0000
(22:42 +0100)
committer
Volker Lendecke
<vl@samba.org>
Mon, 29 Dec 2008 11:12:59 +0000
(12:12 +0100)
source/lib/system.c
patch
|
blob
|
history
diff --git
a/source/lib/system.c
b/source/lib/system.c
index 5b06d3c7600e943ab5dd33f66a26f4d0f37bb1ae..48ecf903d94d65462b2b7d1587a007b64c421931 100644
(file)
--- a/
source/lib/system.c
+++ b/
source/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);