From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Mon, 27 Sep 2010 15:36:27 -0400 Message-ID: <4CA0F23B.6050109@cornell.edu> References: <878w2tx6gk.fsf@gmx.de> <4C9A493F.4050701@cornell.edu> <874odhyliu.fsf@gmx.de> <4C9B452E.1040101@cornell.edu> <4C9B63A1.2060604@cornell.edu> <87y6asy0uh.fsf@gmx.de> <4C9BBD5C.30201@cornell.edu> <83tylgtbo8.fsf@gnu.org> <871v8jhcw2.fsf@gmx.de> <4C9CB57E.1010708@swipnet.se> <8339sztayd.fsf@gnu.org> <87tyleetju.fsf@gmx.de> <4C9DA26F.4030007@swipnet.se> <87mxr5epfa.fsf@gmx.de> <4C9E39A1.8050608@swipnet.se> <87hbhdee7k.fsf@gmx.de> <4C9F7563.3090608@swipnet.se> <87mxr4bb9s.fsf@gmx.de> <4C9F9C49.5090107@swipnet.se> <87bp7jb3jy.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285617085 9536 80.91.229.12 (27 Sep 2010 19:51:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2010 19:51:25 +0000 (UTC) Cc: =?UTF-8?B?SmFuIERqw6Rydg==?= , emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 21:51:23 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0JjI-0004ax-Rp for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 21:51:17 +0200 Original-Received: from localhost ([127.0.0.1]:50387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0JjI-0007Bh-4M for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 15:51:16 -0400 Original-Received: from [140.186.70.92] (port=33474 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0JjA-0007Ax-6X for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:51:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0Jj8-0007UI-6M for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:51:08 -0400 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141]:39843 helo=authusersmtp.mail.cornell.edu) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0Jj8-00078H-1M for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:51:06 -0400 Original-Received: from [128.84.234.191] (markov.math.cornell.edu [128.84.234.191]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id o8RJaNb3007024 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 27 Sep 2010 15:36:23 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 In-Reply-To: <87bp7jb3jy.fsf@gmx.de> X-MIME-Autoconverted: from 8bit to quoted-printable by authusersmtp.mail.cornell.edu id o8RJaNb3007024 X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131017 Archived-At: On 9/27/2010 11:37 AM, Michael Albinus wrote: > Jan Dj=C3=A4rv writes: > >>> * dbus_fd_cb calls only xd_read_queued_messages. Couldn't both functi= ons >>> be merged? Or, since we have the file descriptor in the callback, >>> shouldn't we call only xd_read_message for that socket? >> >> Yes and yes. I was lazy, I saw that xd_read_queued_messages wasn't >> static and kept it just in case. I wasn't sure how to get the >> DbusConnection from a fd so I skipped that. But feel free to make any >> changes you think appropriate. I don't think xd_get_dispatch_status >> and xd_pending_messages are used for example. > > I've tried to adapt it as much as possible. I've kept > xd_read_queued_messages in order to be able to catch errors from > xd_read_message. > >>> * We assume that communication is socket base. This must not be true; >>> see the comment in >>> . If >>> xd_find_watch_fd returns -1, we shall raise an error at least. >> >> I'm not sure what you mean. If you look at the code, the functions >> dbus_watch_get_fd, dbus_watch_get_unix_fd and dbus_watch_get_socket >> all return the same thing, watch->fd. We don't really assume socket, >> any fd that can be passed to select will do. In practice on Unix-like >> systems, we can't get -1 (minus dbus-bugs of course). > > Yes, you are right. If dbus_watch_get* returns something less than zero= , > we silently return as well. This might be sufficient. To finish off the Cygwin issue that started this thread, dbus now works=20 fine in emacs-24 under Cygwin, but not in emacs-23. Would anyone object=20 if I were to apply the following patch to the emacs-23 branch to fix the=20 (Cygwin-specific) problem there? =3D=3D=3D modified file 'src/keyboard.c' --- src/keyboard.c 2010-07-05 17:16:59 +0000 +++ src/keyboard.c 2010-09-27 19:33:05 +0000 @@ -4107,7 +4107,7 @@ interrupt handlers have not read it, read it now. */ /* Note SIGIO has been undef'd if FIONREAD is missing. */ -#ifdef SIGIO +#if defined (SIGIO) || defined (CYGWIN) gobble_input (0); #endif /* SIGIO */ if (kbd_fetch_ptr !=3D kbd_store_ptr) If this is OK, I have one more question: How do I guarantee that the=20 patch doesn't propagate to the trunk? Is it enough to say in the log=20 message that it's for emacs-23 only? Ken