Line 0
Link Here
|
|
|
1 |
--- posixos.c.orig 2016-05-21 20:21:52 UTC |
2 |
+++ posixos.c |
3 |
@@ -77,6 +77,10 @@ jobserver_setup (int slots) |
4 |
if (r != 1) |
5 |
pfatal_with_name (_("init jobserver pipe")); |
6 |
} |
7 |
+#ifdef HAVE_PSELECT |
8 |
+ int flags = fcntl(job_fds[0], F_GETFL, 0); |
9 |
+ fcntl(job_fds[0], F_SETFL, flags | O_NONBLOCK); |
10 |
+#endif |
11 |
|
12 |
return 1; |
13 |
} |
14 |
@@ -112,6 +116,10 @@ jobserver_parse_auth (const char *auth) |
15 |
|
16 |
return 0; |
17 |
} |
18 |
+#ifdef HAVE_PSELECT |
19 |
+ int flags = fcntl(job_fds[0], F_GETFL, 0); |
20 |
+ fcntl(job_fds[0], F_SETFL, flags | O_NONBLOCK); |
21 |
+#endif |
22 |
|
23 |
return 1; |
24 |
} |
25 |
@@ -275,7 +283,7 @@ jobserver_acquire (int timeout) |
26 |
|
27 |
/* The read FD is ready: read it! */ |
28 |
EINTRLOOP (r, read (job_fds[0], &intake, 1)); |
29 |
- if (r < 0) |
30 |
+ if (r < 0 && errno != EAGAIN) |
31 |
pfatal_with_name (_("read jobs pipe")); |
32 |
|
33 |
/* What does it mean if read() returns 0? It shouldn't happen because only |