emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading D-Bus messages


From: Ken Brown
Subject: Re: Reading D-Bus messages
Date: Mon, 27 Sep 2010 15:36:27 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

On 9/27/2010 11:37 AM, Michael Albinus wrote:
Jan Djärv<address@hidden>  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
    
<http://dbus.freedesktop.org/doc/dbus/api/html/group__DBusConnection.html#gb9b8b4064fe2bc36f89f399f32979398>.
 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 fine in emacs-24 under Cygwin, but not in emacs-23. Would anyone object if I were to apply the following patch to the emacs-23 branch to fix the (Cygwin-specific) problem there?

=== 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 != kbd_store_ptr)


If this is OK, I have one more question: How do I guarantee that the patch doesn't propagate to the trunk? Is it enough to say in the log message that it's for emacs-23 only?

Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]