summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChip Coldwell <coldwell@physics.harvard.edu>2004-06-24 09:56:19 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-06-11 15:33:46 -0700
commit8e0b23e24556fb6c6b9943bf3747e70b245fc7aa (patch)
tree99075cb9b5749a5e0b75a04e2b35a129b6a55c99
parenta8927ee05efba3afe955731bab5d633879c39833 (diff)
X.Org Bug 10632 / Debian Bug 256299: race condition in policy.c:Willing()
X.Org Bugzilla #10632 <https://bugs.freedesktop.org/show_bug.cgi?id=10632> Reported upstream from Debian Bug #256299 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256299>
-rw-r--r--policy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/policy.c b/policy.c
index c18103d..a9d4bcf 100644
--- a/policy.c
+++ b/policy.c
@@ -140,8 +140,9 @@ Willing (
if ((fd = popen(willing, "r")))
{
char *s = NULL;
+ errno = 0;
while(!(s = fgets(statusBuf, 256, fd)) && errno == EINTR)
- ;
+ errno = 0;
if (s && strlen(statusBuf) > 0)
statusBuf[strlen(statusBuf)-1] = 0; /* chop newline */
else