summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cvs/src
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-05-30 07:48:45 +0000
committerderaadt <deraadt@openbsd.org>1996-05-30 07:48:45 +0000
commitbf52ccc876e4429404e8367680c96a18466612e6 (patch)
treeb21d3ec8a713cd331bd2cbb56b7aa5e9e1a932a3 /gnu/usr.bin/cvs/src
parentadd md5crypt() (diff)
downloadwireguard-openbsd-bf52ccc876e4429404e8367680c96a18466612e6.tar.xz
wireguard-openbsd-bf52ccc876e4429404e8367680c96a18466612e6.zip
who wrote this code? nonblocking pipe, select, and then not deal with a
read of zero? spin city. i think this deals properly with dead sockets.
Diffstat (limited to 'gnu/usr.bin/cvs/src')
-rw-r--r--gnu/usr.bin/cvs/src/server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c
index 873a132e97c..9e9b09018f3 100644
--- a/gnu/usr.bin/cvs/src/server.c
+++ b/gnu/usr.bin/cvs/src/server.c
@@ -2757,6 +2757,7 @@ server_pause_check()
{
int paused = 0;
char buf[1];
+ int n;
while (read (flowcontrol_pipe[0], buf, 1) == 1)
{
@@ -2788,7 +2789,7 @@ server_pause_check()
if (FD_ISSET (flowcontrol_pipe[0], &fds))
{
- while (read (flowcontrol_pipe[0], buf, 1) == 1)
+ while ((n = read (flowcontrol_pipe[0], buf, 1) == 1))
{
if (*buf == 'S') /* Stop */
paused = 1;
@@ -2797,6 +2798,8 @@ server_pause_check()
else
return; /* ??? */
}
+ if (n == 0)
+ paused = 0; /* other end died */
}
}
}