diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/system.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index 61f93dd6a5..7734328795 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -118,6 +118,21 @@ ssize_t sys_send(int s, const void *msg, size_t len, int flags) } /******************************************************************* +A sendto wrapper that will deal with EINTR. +********************************************************************/ + +ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) +{ + ssize_t ret; + + do { + errno = 0; + ret = sendto(s, msg, len, flags, to, tolen); + } while (ret == -1 && errno == EINTR); + return ret; +} + +/******************************************************************* A recvfrom wrapper that will deal with EINTR. ********************************************************************/ |