From aed26bd8bb8aeaf38cbb82433d5d945e904bd212 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 6 Mar 2015 08:16:46 +0100 Subject: [PATCH] Complete rename to _dbus_socketpair() (this patch is going to be merged into the related base patch). --- bus/dispatch.c | 4 ++-- dbus/dbus-spawn-win.c | 6 +++--- dbus/dbus-sysdeps-unix.c | 4 ++-- dbus/dbus-sysdeps-win.c | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/bus/dispatch.c b/bus/dispatch.c index 5cb9d6f..62c4eb5 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -5058,10 +5058,10 @@ bus_unix_fds_passing_test(const DBusString *test_data_dir) if (!(m = dbus_message_new_signal("/", "a.b.c", "d"))) _dbus_assert_not_reached ("could not alloc message"); - if (!(_dbus_full_duplex_pipe(one, one+1, TRUE, &error))) + if (!(_dbus_socketpair (one, one+1, TRUE, &error))) _dbus_assert_not_reached("Failed to allocate pipe #1"); - if (!(_dbus_full_duplex_pipe(two, two+1, TRUE, &error))) + if (!(_dbus_socketpair (two, two+1, TRUE, &error))) _dbus_assert_not_reached("Failed to allocate pipe #2"); if (!dbus_message_append_args(m, diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c index 7da7a43..f7b56d1 100644 --- a/dbus/dbus-spawn-win.c +++ b/dbus/dbus-spawn-win.c @@ -686,9 +686,9 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p, } PING(); - if (!_dbus_full_duplex_pipe (&sitter->socket_to_babysitter, - &sitter->socket_to_main, - FALSE, error)) + if (!_dbus_socketpair (&sitter->socket_to_babysitter, + &sitter->socket_to_main, + FALSE, error)) goto out0; sitter->sitter_watch = _dbus_watch_new (sitter->socket_to_babysitter, diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index ec0c1d1..ab7efc2 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3346,9 +3346,9 @@ _dbus_socketpair (int *fd1, return TRUE; #else - _dbus_warn ("_dbus_full_duplex_pipe() not implemented on this OS\n"); + _dbus_warn ("_dbus_socketpair() not implemented on this OS\n"); dbus_set_error (error, DBUS_ERROR_FAILED, - "_dbus_full_duplex_pipe() not implemented on this OS"); + "_dbus_socketpair() not implemented on this OS"); return FALSE; #endif } diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 5025815..6e59c5e 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1045,20 +1045,22 @@ failed: ************************************************************************/ /** - * Creates a full-duplex pipe (as in socketpair()). - * Sets both ends of the pipe nonblocking. + * Creates pair of connect sockets (as in socketpair()). + * Sets both ends of the pair nonblocking. + * + * Marks both file descriptors as close-on-exec * * @param fd1 return location for one end * @param fd2 return location for the other end - * @param blocking #TRUE if pipe should be blocking + * @param blocking #TRUE if pair should be blocking * @param error error return * @returns #FALSE on failure (if error is set) - */ +*/ dbus_bool_t -_dbus_full_duplex_pipe (int *fd1, - int *fd2, - dbus_bool_t blocking, - DBusError *error) +_dbus_socketpair (int *fd1, + int *fd2, + dbus_bool_t blocking, + DBusError *error) { SOCKET temp, socket1 = -1, socket2 = -1; struct sockaddr_in saddr; -- 1.8.4.5