Changeset 232 for branches/samba-3.2.x/source/lib/system.c
- Timestamp:
- May 27, 2009, 9:09:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/lib/system.c
r137 r232 149 149 } while (ret == -1 && ((errno == EINTR)||(errno == EAGAIN))); 150 150 #endif 151 return ret; 152 } 153 154 /******************************************************************* 155 A writev wrapper that will deal with EINTR. 156 ********************************************************************/ 157 158 ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt) 159 { 160 ssize_t ret; 161 162 #if 0 163 /* Try to confuse write_data_iov a bit */ 164 if ((random() % 5) == 0) { 165 return sys_write(fd, iov[0].iov_base, iov[0].iov_len); 166 } 167 if (iov[0].iov_len > 1) { 168 return sys_write(fd, iov[0].iov_base, 169 (random() % (iov[0].iov_len-1)) + 1); 170 } 171 #endif 172 173 do { 174 ret = writev(fd, iov, iovcnt); 175 } while (ret == -1 && errno == EINTR); 151 176 return ret; 152 177 }
Note:
See TracChangeset
for help on using the changeset viewer.