aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Pluim2015-09-05 11:37:29 +0300
committerEli Zaretskii2015-09-05 11:37:29 +0300
commitac9da241986b747c1122ad5d097db42795eb9737 (patch)
tree2a2b20cf999edbcfdeab5c5049daadd2be49d57b /src
parentec14f087535282c188861815ac806024274185d5 (diff)
downloademacs-ac9da241986b747c1122ad5d097db42795eb9737.tar.gz
emacs-ac9da241986b747c1122ad5d097db42795eb9737.zip
Avoid read error messages from 'inotify'
* src/process.c (wait_reading_process_output): Add a 'tls_available' set and manipulate it instead of 'Available' when checking TLS inputs. Assign the value to 'Available' only if we find any TLS data waiting to be read. This avoids error messages from 'inotify' that tries to read data it shouldn't. (Bug#21337)
Diffstat (limited to 'src')
-rw-r--r--src/process.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index 1ab83780914..f4613be28ed 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4859,6 +4859,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4859 data is available in the buffers manually. */ 4859 data is available in the buffers manually. */
4860 if (nfds == 0) 4860 if (nfds == 0)
4861 { 4861 {
4862 fd_set tls_available;
4863 int set = 0;
4864
4865 FD_ZERO (&tls_available);
4862 if (! wait_proc) 4866 if (! wait_proc)
4863 { 4867 {
4864 /* We're not waiting on a specific process, so loop 4868 /* We're not waiting on a specific process, so loop
@@ -4879,7 +4883,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4879 { 4883 {
4880 nfds++; 4884 nfds++;
4881 eassert (p->infd == channel); 4885 eassert (p->infd == channel);
4882 FD_SET (p->infd, &Available); 4886 FD_SET (p->infd, &tls_available);
4887 set++;
4883 } 4888 }
4884 } 4889 }
4885 } 4890 }
@@ -4896,9 +4901,12 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4896 nfds = 1; 4901 nfds = 1;
4897 eassert (0 <= wait_proc->infd); 4902 eassert (0 <= wait_proc->infd);
4898 /* Set to Available. */ 4903 /* Set to Available. */
4899 FD_SET (wait_proc->infd, &Available); 4904 FD_SET (wait_proc->infd, &tls_available);
4905 set++;
4900 } 4906 }
4901 } 4907 }
4908 if (set)
4909 Available = tls_available;
4902 } 4910 }
4903#endif 4911#endif
4904 } 4912 }