From 47bdc2c7c40e9e48e9f9862e6c6409fccd38100e Mon Sep 17 00:00:00 2001 From: neo23 Date: Sun, 14 Apr 2002 16:59:08 +0000 Subject: [PATCH] Applied a patch from Arien that makes the pipe nonblocking. This doesn't solve #482012 but makes it more obvious what is going wrong if the pipe fills up. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@132 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- check/src/check_msg.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/check/src/check_msg.c b/check/src/check_msg.c index ae7b8e0..5827fca 100644 --- a/check/src/check_msg.c +++ b/check/src/check_msg.c @@ -19,9 +19,10 @@ */ #include -#include "unistd.h" -#include "stdlib.h" -#include "stdio.h" +#include +#include +#include +#include #include "list.h" #include "check_error.h" #include "check.h" @@ -242,11 +243,21 @@ static void setup_pipe (Pipe *p) { int fd[2]; - pipe(fd); + pipe (fd); + p->sendfd = fd[1]; p->recvfd = fd[0]; + + /* + * Make the pipe nonblocking so we don't block when too many + * messages are sent while the other end of the pipe waits for the + * test to exit (see bug #482012). This doesn't solve our problem, + * but it makes it more obvious what is happening since instead of + * blocking the test exits with "Resource temporarily unavailable". + */ + fcntl (p->sendfd, F_SETFL, O_NONBLOCK); } - + void setup_messaging_with_key (MsgKey *key) { PipeEntry *pe; -- 2.50.0