From 0a32e31cbe6a3d1c9ce0e8e2338bde1ddbf769a9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 5 Oct 2006 12:33:59 +0000 Subject: [PATCH] r19101: add sys_recv() wrapper metze (This used to be commit 2f146ec68344c4bc11e1a9d174bdf548e1a22d5a) --- source3/lib/system.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source3/lib/system.c b/source3/lib/system.c index 42f9615c9e4..d92262a786d 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. ********************************************************************/ @@ -174,6 +173,20 @@ ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct return ret; } +/******************************************************************* +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. ********************************************************************/