dbus-sysdeps-unix.h
Havoc Pennington
hp at redhat.com
Tue Sep 12 08:46:43 PDT 2006
Peter Kümmel wrote:
> Looking at the code again, I see that a public file access
> interface isn't necessary, at least when we don't move some
> files back to sysdeps.c: Currently all relevant code
> are in -win/-unix files.
> Maybe dbus_create_file_exclusively() as public function is enough.
Agreed, I was just thinking that also. We're overcomplicating this. We
don't need read/write/close on files; we can just export stuff like
_dbus_file_get_contents
_dbus_create_empty_file_exclusively
_dbus_file_set_contents
and other high-level operations.
You could try to just get rid of all uses of read/write/close on files
(outside of -unix.c/-win.c), replacing them with functions like the
above (first patch), then (second patch) rename read/write/close/poll to
be read_socket, write_socket, close_socket. I think it would be fine to
keep the socket as "int" instead of a DBusSocket, since it's an int on
both platforms, and we won't have a file int in the api at all.
Havoc
More information about the dbus
mailing list