summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 11:11:19 -0400
committerJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 11:11:19 -0400
commit960fef844bdb0054c082a31e43f9631b1d5eb69b (patch)
treee39cc0f5db0dce6149711c9088d2965130ade8e0
parenta37404111be4912cd8b51080bcbe219edded35f5 (diff)
parent68f69d38182ed5974984b0434086e6a288b477cb (diff)
Merge branch 'master' of git+ssh://johnp@git.freedesktop.org/git/dbus/dbus
Conflicts: ChangeLog
-rw-r--r--ChangeLog41
-rw-r--r--bus/dir-watch-inotify.c6
-rw-r--r--dbus/dbus-bus.c12
-rw-r--r--tools/dbus-launch-x11.c10
-rw-r--r--tools/dbus-launch.c18
-rw-r--r--tools/dbus-send.c6
6 files changed, 69 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 48fe5810..96a0aeb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-04-01 Timo Hoenig <thoenig@suse.de>
+
+ Patch from Frederic Crozat <fcrozat@mandriva.com>
+
+ * bus/dir-watch-inotify.c (bus_watch_directory): Only monitor
+ IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This
+ way, only atomic changes to configuration file are monitored.
+ * bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in
+ _dbus_verbose function call
+ * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use
+ _dbus_strerror instead of perror
+
2008-03-04 Havoc Pennington <hp@redhat.com>
* bus/connection.c, bus/expirelist.c: Make the BusExpireList
@@ -8,6 +20,35 @@
updated, since we need to e.g. take some action whenever adding
and removing stuff from the expire list.
+2008-03-31 Colin Walters <walters@verbum.org>
+
+ Patch from Owen Taylor <otaylor@redhat.com>
+
+ * tools/dbus-launch-x11.c: Check for X11 events before
+ selecting (FDO bug #15293)
+
+2008-03-31 Colin Walters <walters@verbum.org>
+
+ Patch from Owen Taylor <otaylor@redhat.com>
+
+ * tools/dbus-launch-x11.c: Make sure we call XFlush()
+ on all code paths (FDO bug #15293)
+
+2008-03-27 Havoc Pennington <hp@redhat.com>
+
+ * tools/dbus-send.c (append_dict): Do not provide a signature to
+ dbus_message_iter_open_container() when opening a dict entry.
+
+2008-03-26 Colin Walters <walters@verbum.org>
+
+ Patch from Scott James Remnant <scott@netsplit.com>
+
+ * dbus/dbus-bus.c: Set default exit_on_disconnect after registration with
+ the bus, not before. This ensures that programs which wish to set
+ exit_on_disconnect to FALSE will not be terminated if the bus exits
+ during registration. (FDO Bug #15112)
+>>>>>>> 68f69d38182ed5974984b0434086e6a288b477cb:ChangeLog
+
2008-03-04 John (J5) Palmieri <johnp@redhat.com>
* fix broken poll on Mac OSX - build patch by Benjamin Reed
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c
index 1622cde2..e15faadc 100644
--- a/bus/dir-watch-inotify.c
+++ b/bus/dir-watch-inotify.c
@@ -64,7 +64,7 @@ _handle_inotify_watch (DBusWatch *watch, unsigned int flags, void *data)
ret = read (inotify_fd, buffer, INOTIFY_BUF_LEN);
if (ret < 0)
- _dbus_verbose ("Error reading inotify event: '%s'\n, _dbus_strerror(errno)");
+ _dbus_verbose ("Error reading inotify event: '%s'\n", _dbus_strerror(errno));
else if (!ret)
_dbus_verbose ("Error reading inotify event: buffer too small\n");
@@ -134,7 +134,7 @@ bus_watch_directory (const char *dir, BusContext *context)
goto out;
}
- wd = inotify_add_watch (inotify_fd, dir, IN_MODIFY | IN_CREATE | IN_DELETE);
+ wd = inotify_add_watch (inotify_fd, dir, IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO | IN_MOVED_FROM);
if (wd < 0)
{
_dbus_warn ("Cannot setup inotify for '%s'; error '%s'\n", dir, _dbus_strerror (errno));
@@ -156,7 +156,7 @@ bus_drop_all_directory_watches (void)
_dbus_verbose ("Dropping all watches on config directories\n");
ret = close (inotify_fd);
if (ret)
- _dbus_verbose ("Error dropping watches: '%s'\n", perror(ret));
+ _dbus_verbose ("Error dropping watches: '%s'\n", _dbus_strerror(errno));
num_wds = 0;
inotify_fd = -1;
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
index c7f43e8c..e159dae7 100644
--- a/dbus/dbus-bus.c
+++ b/dbus/dbus-bus.c
@@ -436,12 +436,6 @@ internal_bus_get (DBusBusType type,
return NULL;
}
- /* By default we're bound to the lifecycle of
- * the message bus.
- */
- dbus_connection_set_exit_on_disconnect (connection,
- TRUE);
-
if (!dbus_bus_register (connection, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
@@ -461,6 +455,12 @@ internal_bus_get (DBusBusType type,
bus_connections[type] = connection;
}
+ /* By default we're bound to the lifecycle of
+ * the message bus.
+ */
+ dbus_connection_set_exit_on_disconnect (connection,
+ TRUE);
+
_DBUS_LOCK (bus_datas);
bd = ensure_bus_data (connection);
_dbus_assert (bd != NULL); /* it should have been created on
diff --git a/tools/dbus-launch-x11.c b/tools/dbus-launch-x11.c
index 927d8634..442e9ba2 100644
--- a/tools/dbus-launch-x11.c
+++ b/tools/dbus-launch-x11.c
@@ -341,7 +341,7 @@ static Window
set_address_in_x11(char *address, pid_t pid)
{
char *current_address;
- Window wid;
+ Window wid = None;
unsigned long pid32; /* Xlib property functions want _long_ not 32-bit for format "32" */
/* lock the X11 display to make sure we're doing this atomically */
@@ -350,16 +350,14 @@ set_address_in_x11(char *address, pid_t pid)
if (!x11_get_address (&current_address, NULL, NULL))
{
/* error! */
- XUngrabServer (xdisplay);
- return None;
+ goto out;
}
if (current_address != NULL)
{
/* someone saved the address in the meantime */
- XUngrabServer (xdisplay);
free (current_address);
- return None;
+ goto out;
}
/* Create our window */
@@ -378,9 +376,11 @@ set_address_in_x11(char *address, pid_t pid)
/* Now grab the selection */
XSetSelectionOwner (xdisplay, selection_atom, wid, CurrentTime);
+ out:
/* Ungrab the server to let other people use it too */
XUngrabServer (xdisplay);
+ /* And make sure that the ungrab gets sent to X11 */
XFlush (xdisplay);
return wid;
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c
index 6a10ffa3..216f7435 100644
--- a/tools/dbus-launch.c
+++ b/tools/dbus-launch.c
@@ -458,6 +458,17 @@ kill_bus_when_session_ends (void)
while (TRUE)
{
+#ifdef DBUS_BUILD_X11
+ /* Dump events on the floor, and let
+ * IO error handler run if we lose
+ * the X connection. It's important to
+ * run this before going into select() since
+ * we might have queued outgoing messages or
+ * events.
+ */
+ x11_handle_event ();
+#endif
+
FD_ZERO (&read_set);
FD_ZERO (&err_set);
@@ -472,7 +483,7 @@ kill_bus_when_session_ends (void)
FD_SET (x_fd, &read_set);
FD_SET (x_fd, &err_set);
}
-
+
select (MAX (tty_fd, x_fd) + 1,
&read_set, NULL, &err_set, NULL);
@@ -483,15 +494,12 @@ kill_bus_when_session_ends (void)
}
#ifdef DBUS_BUILD_X11
- /* Dump events on the floor, and let
- * IO error handler run if we lose
- * the X connection
+ /* Events will be processed before we select again
*/
if (x_fd >= 0)
verbose ("X fd condition reading = %d error = %d\n",
FD_ISSET (x_fd, &read_set),
FD_ISSET (x_fd, &err_set));
- x11_handle_event ();
#endif
if (tty_fd >= 0)
diff --git a/tools/dbus-send.c b/tools/dbus-send.c
index 66d0bcf9..407c0497 100644
--- a/tools/dbus-send.c
+++ b/tools/dbus-send.c
@@ -150,14 +150,10 @@ append_dict (DBusMessageIter *iter, int keytype, int valtype, const char *value)
while (val != NULL)
{
DBusMessageIter subiter;
- char sig[3];
- sig[0] = keytype;
- sig[1] = valtype;
- sig[2] = '\0';
dbus_message_iter_open_container (iter,
DBUS_TYPE_DICT_ENTRY,
- sig,
+ NULL,
&subiter);
append_arg (&subiter, keytype, val);