From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Mon, 27 Sep 2010 17:37:37 +0200 Message-ID: <87bp7jb3jy.fsf@gmx.de> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285604741 17313 80.91.229.12 (27 Sep 2010 16:25:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2010 16:25:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jan =?utf-8?Q?Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 17:38:05 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 1P0FmC-0000bb-PD for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 17:38:01 +0200 Original-Received: from localhost ([127.0.0.1]:59336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0FmB-0003uQ-NM for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 11:37:59 -0400 Original-Received: from [140.186.70.92] (port=45755 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0Fm4-0003su-Pc for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:37:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0Fm3-0000xl-6X for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:37:52 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:57623 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1P0Fm2-0000xM-Qb for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:37:51 -0400 Original-Received: (qmail invoked by alias); 27 Sep 2010 15:37:46 -0000 Original-Received: from p4FC19466.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.148.102] by mail.gmx.net (mp005) with SMTP; 27 Sep 2010 17:37:46 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+Yt+IGMTaY09eWUqOgmjmlYPlt/W6y4JerZtomCu Y7X3iY7Ik6n4st In-Reply-To: <4C9F9C49.5090107@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Sun, 26 Sep 2010 21:17:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:131009 Archived-At: Jan Dj=C3=A4rv writes: >> * dbus_fd_cb calls only xd_read_queued_messages. Couldn't both functions >> 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. > Jan D. Best regards, Michael.