summaryrefslogtreecommitdiff
path: root/src/libunixonacid/unixmessage_receive.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/unixmessage_receive.c')
-rw-r--r--src/libunixonacid/unixmessage_receive.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libunixonacid/unixmessage_receive.c b/src/libunixonacid/unixmessage_receive.c
index d25195b..21491fa 100644
--- a/src/libunixonacid/unixmessage_receive.c
+++ b/src/libunixonacid/unixmessage_receive.c
@@ -49,7 +49,7 @@ static int unixmessage_receiver_fill (unixmessage_receiver_t *b)
.msg_controllen = sizeof(ancilbuf)
} ;
unsigned int auxlen ;
- int r ;
+ int r = -1 ;
if (cbuffer_isfull(&b->mainb) || cbuffer_isfull(&b->auxb))
return (errno = ENOBUFS, -1) ;
{
@@ -57,8 +57,11 @@ static int unixmessage_receiver_fill (unixmessage_receiver_t *b)
cbuffer_wpeek(&b->mainb, v) ;
iovec_from_siovec(iov, v, 2) ;
}
- r = recvmsg(b->fd, &msghdr, awesomeflags) ;
- if (r <= 0) return r ;
+ while (r < 0)
+ {
+ r = recvmsg(b->fd, &msghdr, awesomeflags) ;
+ if (!r || (r < 0 && errno != EINTR)) return r ;
+ }
{
struct cmsghdr *c = CMSG_FIRSTHDR(&msghdr) ;
if (c)