diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-10-05 12:33:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:12 -0500 |
commit | 2f146ec68344c4bc11e1a9d174bdf548e1a22d5a (patch) | |
tree | dc87d7e4fb4eb4a2389049a095cf4896ae15324e /source/lib/system.c | |
parent | 5faf816885b7a1bca5a25ab1ef5151d4e364cbda (diff) | |
download | samba-2f146ec68344c4bc11e1a9d174bdf548e1a22d5a.tar.gz samba-2f146ec68344c4bc11e1a9d174bdf548e1a22d5a.tar.xz samba-2f146ec68344c4bc11e1a9d174bdf548e1a22d5a.zip |
r19101: add sys_recv() wrapper
metze
Diffstat (limited to 'source/lib/system.c')
-rw-r--r-- | source/lib/system.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/lib/system.c b/source/lib/system.c index 42f9615c9e4..d92262a786d 100644 --- a/source/lib/system.c +++ b/source/lib/system.c @@ -105,7 +105,6 @@ ssize_t sys_write(int fd, const void *buf, size_t count) return ret; } - /******************************************************************* A pread wrapper that will deal with EINTR and 64-bit file offsets. ********************************************************************/ @@ -175,6 +174,20 @@ ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct } /******************************************************************* +A write wrapper that will deal with EINTR. +********************************************************************/ + +ssize_t sys_recv(int fd, void *buf, size_t count, int flags) +{ + ssize_t ret; + + do { + ret = recv(fd, buf, count, flags); + } while (ret == -1 && errno == EINTR); + return ret; +} + +/******************************************************************* A recvfrom wrapper that will deal with EINTR. ********************************************************************/ |