Darren:

I suspect that this problem should probably be fixed another way.  Note
that if you run dbus-launch like this:

dbus-launch --exit-with-session gnome-session < /dev/null

That this should fix the problem without needing to patch D-Bus code.
It also leaves the normal logic in place for situations where it works
(all cases except when launched by login Xsession scripot where we use
sdt_shell which confuses dbus-launch by sending a Control-D back to the
calling terminal).

I suspect we should remove this patch and update the dt-integration
package so that we call dbus-launch with a command like the above
(just adding the "< /dev/null" part at the end) since this is a less
invasive fix.  Especially since we seem to be having to rework this
patch fairly regularly.

Brian


> With dbus 1.0.x we were patching the dbus-launch.c file using "#ifndef __sun" 
> to comment out a vital
> select() call where the while(TRUE) loop was intended to pause waiting for an 
> event to happen.
> 
> The fix was to only only comment out the calls to FD_SET for the tty_fd and 
> leave the x_fd inplace,
> leaving dbus-launch to wait for an X event to occur.
> 
> Darren.
> 
> PS - The diff below is for this specific change, the patch to be committed 
> will include other
> changes not specific to this fix.
> 
> --------------
> 
> --- SUNWdbus-1.0.2/dbus-1.0.2/tools/dbus-launch.c~      Tue Dec 12 11:30:26 
> 2006
> +++ SUNWdbus-1.0.2/dbus-1.0.2/tools/dbus-launch.c       Fri Dec 15 11:53:50 
> 2006
> @@ -419,36 +419,36 @@
>  #ifndef __sun
>  /*
>   * read() sometimes returns 0 on Solaris in valid conditions, so this
>   * test causes dbus-launch to fail to start gnome-session
>   */
>        if (tty_fd >= 0)
>          {
>            FD_SET (tty_fd, &read_set);
>            FD_SET (tty_fd, &err_set);
>          }
> +#endif
> 
>        if (x_fd >= 0)
>          {
>            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);
> 
>        if (got_sighup)
>          {
>            verbose ("Got SIGHUP, exiting\n");
>            kill_bus_and_exit (0);
>          }
> -#endif
> 
>  #ifdef DBUS_BUILD_X11
>        /* Dump events on the floor, and let
>         * IO error handler run if we lose
>         * the X connection
>         */
>        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));


Reply via email to