Ignore:
Timestamp:
May 27, 2009, 9:09:42 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/lib/system.c

    r137 r232  
    149149        } while (ret == -1 && ((errno == EINTR)||(errno == EAGAIN)));
    150150#endif
     151        return ret;
     152}
     153
     154/*******************************************************************
     155A writev wrapper that will deal with EINTR.
     156********************************************************************/
     157
     158ssize_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);
    151176        return ret;
    152177}
Note: See TracChangeset for help on using the changeset viewer.