git.samba.org
/
tridge
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4d28db
)
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 12:24:28 +0000
(13:24 +0100)
source3/lib/system.c
patch
|
blob
|
history
diff --git
a/source3/lib/system.c
b/source3/lib/system.c
index d52d12bf721ab6e933fb7404d0c1b710ee5d425c..ed66666ddb018d2ca84ce3d2f8de84a7f3ca176f 100644
(file)
--- 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);