[Patch] Moving FD passing into the header

Christian Dywan christian at lanedo.com
Wed Jun 16 04:15:52 PDT 2010


Am Tue, 15 Jun 2010 23:14:32 +0200
schrieb Thiago Macieira <thiago at kde.org>:

> Em Terça-feira 15. Junho 2010, às 18.18.57, Christian Dywan escreveu:
> > Hejsan,
> > 
> > so I changed Unix FD to not be a basic type anymore, and it's not
> > anymore part of the message arguments. Instead you add and retrieve
> > them specifically, see
> > 
> > http://lists.freedesktop.org/archives/dbus/2010-April/012509.html
> > 
> > The API is this:
> > 
> > dbus_bool_t dbus_message_append_unix_fd       (DBusMessage *message,
> >                                                int          fd);
> > dbus_bool_t dbus_message_contains_unix_fds    (DBusMessage
> > *message); int         dbus_message_get_n_unix_fds
> > (DBusMessage *message); int
> > dbus_message_get_unix_fd          (DBusMessage *message,
> > int          index);
> > 
> > *Getting* duplicates the handle. It is an error to try to get more
> > descriptors than exist in the message.
> > 
> > I adjusted the two test cases accordingly to use the new API.
> 
> Are they still part of the signature? How do I differentiate two fds
> from one array of fds?

Hey Thiago,

file descriptor *indices* are no longer part of the signature and you
can't anymore use dbus_message_append_args, dbus_message_get_args and
friends on them.

You append one descriptor after the other and you can read them back in
the order you put them in.

-- 
ciao,
    Christian


More information about the dbus mailing list