From ce4fd314c6be9bfee16a172d5ca34e5097d309fc Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 25 Mar 2003 04:37:08 +0000 Subject: 2003-03-24 Havoc Pennington * 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 --- dbus/dbus-internals.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'dbus/dbus-internals.c') diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index f9d632b4..9588e72b 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -250,40 +250,6 @@ _dbus_strdup (const char *str) return copy; } -/** - * Sets a file descriptor to be nonblocking. - * - * @param fd the file descriptor. - * @param result address of result code. - * @returns #TRUE on success. - */ -dbus_bool_t -_dbus_set_fd_nonblocking (int fd, - DBusResultCode *result) -{ - int val; - - val = fcntl (fd, F_GETFL, 0); - if (val < 0) - { - dbus_set_result (result, _dbus_result_from_errno (errno)); - _dbus_verbose ("Failed to get flags for fd %d: %s\n", fd, - _dbus_strerror (errno)); - return FALSE; - } - - if (fcntl (fd, F_SETFL, val | O_NONBLOCK) < 0) - { - dbus_set_result (result, _dbus_result_from_errno (errno)); - _dbus_verbose ("Failed to set fd %d nonblocking: %s\n", - fd, _dbus_strerror (errno)); - - return FALSE; - } - - return TRUE; -} - /** * Returns a string describing the given type. * -- cgit