The former is Unix-specific, the latter is also portable to Windows.
On Unix, they're really the same thing.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
typedef void (* DBusForeachFunction) (void *element,
void *data);
-dbus_bool_t _dbus_set_fd_nonblocking (int fd,
- DBusError *error);
-
void _dbus_verbose_bytes (const unsigned char *data,
int len,
int offset);
HAVE_LOCK_CHECK (server);
- if (!_dbus_set_fd_nonblocking (client_fd, NULL))
+ if (!_dbus_set_socket_nonblocking (client_fd, NULL))
{
SERVER_UNLOCK (server);
return TRUE;
#endif /* Solaris */
+static dbus_bool_t _dbus_set_fd_nonblocking (int fd,
+ DBusError *error);
+
static dbus_bool_t
_dbus_open_socket (int *fd_p,
int domain,
* @returns #TRUE on success.
*/
dbus_bool_t
+_dbus_set_socket_nonblocking (DBusSocket fd,
+ DBusError *error)
+{
+ return _dbus_set_fd_nonblocking (fd, error);
+}
+
+static dbus_bool_t
_dbus_set_fd_nonblocking (int fd,
DBusError *error)
{
* @returns #TRUE on success.
*/
dbus_bool_t
-_dbus_set_fd_nonblocking (int handle,
- DBusError *error)
+_dbus_set_socket_nonblocking (DBusSocket handle,
+ DBusError *error)
{
u_long one = 1;
/* Every SOCKET is also a HANDLE. */
_dbus_win_handle_set_close_on_exec ((HANDLE) fd);
- if (!_dbus_set_fd_nonblocking (fd, error))
+ if (!_dbus_set_socket_nonblocking (fd, error))
{
closesocket (fd);
return -1;
for (i = 0 ; i < nlisten_fd ; i++)
{
_dbus_win_handle_set_close_on_exec ((HANDLE) listen_fd[i]);
- if (!_dbus_set_fd_nonblocking (listen_fd[i], error))
+ if (!_dbus_set_socket_nonblocking (listen_fd[i], error))
{
goto failed;
}
return s;
}
+dbus_bool_t _dbus_set_socket_nonblocking (DBusSocket fd,
+ DBusError *error);
+
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_close_socket (DBusSocket fd,
DBusError *error);
DBusError *error);
DBusSocket _dbus_accept (DBusSocket listen_fd);
-
dbus_bool_t _dbus_read_credentials_socket (DBusSocket client_fd,
DBusCredentials *credentials,
DBusError *error);