From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#21313: 25.0.50; Strange errors from dbus-handle-event Date: Tue, 22 Sep 2015 10:21:11 +0200 Message-ID: <87oaguq2yw.fsf@gnu.org> References: <877foo4nkd.fsf@gnu.org> <87wpvzs4r3.fsf@gnu.org> <87bnd9cf7g.fsf@gnu.org> <831te53zbq.fsf@gnu.org> <871te5cdg7.fsf@gnu.org> <83wpvx2h16.fsf@gnu.org> <87r3lziti9.fsf@gnu.org> <83zj0n7jtl.fsf@gnu.org> <87wpvjovfu.fsf@gnu.org> <877fnikhms.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442910143 25443 80.91.229.3 (22 Sep 2015 08:22:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Sep 2015 08:22:23 +0000 (UTC) Cc: 21313@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 22 10:22:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZeIq3-0006ih-1g for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Sep 2015 10:22:11 +0200 Original-Received: from localhost ([::1]:37596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeIq2-0007ms-EC for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Sep 2015 04:22:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeIpx-0007k4-D9 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 04:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeIpu-0001nI-AE for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 04:22:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeIpt-0001nD-VQ for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 04:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZeIpt-0007cF-MB for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 04:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Sep 2015 08:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21313 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21313-submit@debbugs.gnu.org id=B21313.144291007629170 (code B ref 21313); Tue, 22 Sep 2015 08:22:01 +0000 Original-Received: (at 21313) by debbugs.gnu.org; 22 Sep 2015 08:21:16 +0000 Original-Received: from localhost ([127.0.0.1]:41219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZeIpA-0007aQ-Al for submit@debbugs.gnu.org; Tue, 22 Sep 2015 04:21:16 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:56600) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZeIp8-0007a8-9p for 21313@debbugs.gnu.org; Tue, 22 Sep 2015 04:21:15 -0400 Original-Received: from thinkpad-t440p (dhcp199.uni-koblenz.de [141.26.71.199]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 4CC103D6004; Tue, 22 Sep 2015 10:21:12 +0200 (CEST) In-Reply-To: <877fnikhms.fsf@gmail.com> (Robert Pluim's message of "Tue, 22 Sep 2015 10:00:59 +0200") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106803 Archived-At: Robert Pluim writes: >>>> --8<---------------cut here---------------start------------->8--- >>>> diff --git a/src/process.c b/src/process.c >>>> index ed5f4c0..7985e37 100644 >>>> --- a/src/process.c >>>> +++ b/src/process.c >>>> @@ -5036,7 +5036,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, >>>> && FD_ISSET (channel, &Available)) >>>> || (d->condition & FOR_WRITE >>>> && FD_ISSET (channel, &write_mask)))) >>>> - d->func (channel, d->data); >>>> + { >>>> + d->func (channel, d->data); >>>> + FD_CLR (channel, &Available); >>>> + } >>>> } >>>> >>>> for (channel = 0; channel <= max_process_desc; channel++) >>>> --8<---------------cut here---------------end--------------->8--- > > What if it was the 'FOR_WRITE' part of the condition that triggered? > Perhaps we should split the 'if'. I think in this case, channel cannot be in Available so by handling this case we could only save one needless operation. But that might be reason enough, so I committed the following patch. --8<---------------cut here---------------start------------->8--- 1 file changed, 10 insertions(+), 7 deletions(-) src/process.c | 17 ++++++++++------- modified src/process.c @@ -5031,14 +5031,17 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, for (channel = 0; channel <= max_input_desc; ++channel) { struct fd_callback_data *d = &fd_callback_info[channel]; - if (d->func - && ((d->condition & FOR_READ - && FD_ISSET (channel, &Available)) - || (d->condition & FOR_WRITE - && FD_ISSET (channel, &write_mask)))) + if (d->func) { - d->func (channel, d->data); - FD_CLR (channel, &Available); + if (d->condition & FOR_READ + && FD_ISSET (channel, &Available)) + { + d->func (channel, d->data); + FD_CLR (channel, &Available); + } + else if (d->condition & FOR_WRITE + && FD_ISSET (channel, &write_mask)) + d->func (channel, d->data); } } --8<---------------cut here---------------end--------------->8--- Bye, Tassilo