diff options
author | Havoc Pennington <hp@redhat.com> | 2003-03-25 04:37:08 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-03-25 04:37:08 +0000 |
commit | ce4fd314c6be9bfee16a172d5ca34e5097d309fc (patch) | |
tree | 744b8524f183a0fbb009d917029c9a129b34da9e /dbus/dbus-server-unix.c | |
parent | 44fff656885ac32e319feb98fd0d06680d602977 (diff) |
2003-03-24 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
file
* dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
NULL argument for "message" if the error is a well-known one,
fill in a generic message in this case.
* dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
favor of DBusError
* bus/test.c (bus_test_flush_bus): add
* bus/policy.c (bus_policy_test): test code stub
Diffstat (limited to 'dbus/dbus-server-unix.c')
-rw-r--r-- | dbus/dbus-server-unix.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c index 88cc9ed7..41553fe2 100644 --- a/dbus/dbus-server-unix.c +++ b/dbus/dbus-server-unix.c @@ -250,17 +250,19 @@ _dbus_server_new_for_fd (int fd) * Creates a new server listening on the given Unix domain socket. * * @param path the path for the domain socket. - * @param result location to store reason for failure. + * @param error location to store reason for failure. * @returns the new server, or #NULL on failure. */ DBusServer* _dbus_server_new_for_domain_socket (const char *path, - DBusResultCode *result) + DBusError *error) { DBusServer *server; int listen_fd; - listen_fd = _dbus_listen_unix_socket (path, result); + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + + listen_fd = _dbus_listen_unix_socket (path, error); _dbus_fd_set_close_on_exec (listen_fd); if (listen_fd < 0) @@ -269,7 +271,7 @@ _dbus_server_new_for_domain_socket (const char *path, server = _dbus_server_new_for_fd (listen_fd); if (server == NULL) { - dbus_set_result (result, DBUS_RESULT_NO_MEMORY); + dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); close (listen_fd); return NULL; } @@ -278,22 +280,25 @@ _dbus_server_new_for_domain_socket (const char *path, } /** - * Creates a new server listening on the given hostname and port + * Creates a new server listening on the given hostname and port. + * If the hostname is NULL, listens on localhost. * * @param host the hostname to listen on. * @param port the port to listen on. - * @param result location to store reason for failure. + * @param error location to store reason for failure. * @returns the new server, or #NULL on failure. */ DBusServer* _dbus_server_new_for_tcp_socket (const char *host, dbus_uint32_t port, - DBusResultCode *result) + DBusError *error) { DBusServer *server; int listen_fd; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); - listen_fd = _dbus_listen_tcp_socket (host, port, result); + listen_fd = _dbus_listen_tcp_socket (host, port, error); _dbus_fd_set_close_on_exec (listen_fd); if (listen_fd < 0) @@ -302,7 +307,7 @@ _dbus_server_new_for_tcp_socket (const char *host, server = _dbus_server_new_for_fd (listen_fd); if (server == NULL) { - dbus_set_result (result, DBUS_RESULT_NO_MEMORY); + dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); close (listen_fd); return NULL; } |