summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-05 12:33:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:12 -0500
commit0a32e31cbe6a3d1c9ce0e8e2338bde1ddbf769a9 (patch)
treebb35d507f1768acefc12171b9b854f109107948f /source3/lib
parent4366ca702dbb1566ee5dc8ffca95a36cf83032a5 (diff)
downloadsamba-0a32e31cbe6a3d1c9ce0e8e2338bde1ddbf769a9.tar.gz
samba-0a32e31cbe6a3d1c9ce0e8e2338bde1ddbf769a9.tar.bz2
samba-0a32e31cbe6a3d1c9ce0e8e2338bde1ddbf769a9.zip
r19101: add sys_recv() wrapper
metze (This used to be commit 2f146ec68344c4bc11e1a9d174bdf548e1a22d5a)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 42f9615c9e..d92262a786 100644
--- a/source3/lib/system.c
+++ b/source3/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.
********************************************************************/