]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Rename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair().
authorRalf Habacker <ralf.habacker@freenet.de>
Fri, 6 Mar 2015 07:09:57 +0000 (08:09 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 11 Mar 2015 14:22:57 +0000 (15:22 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444

bus/dispatch.c
bus/main.c
dbus/dbus-server-debug-pipe.c
dbus/dbus-spawn-win.c
dbus/dbus-spawn.c
dbus/dbus-sysdeps-unix.c
dbus/dbus-sysdeps-win.c
dbus/dbus-sysdeps.h

index 5cb9d6f4e0fa837c3c2d03de82ad3005243ca4a8..62c4eb58181b316ff43f1d8039e0e5d7774386bb 100644 (file)
@@ -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,
index ad02b97ecc362a35ad3df60a6fa952c38e7f0b35..267a50837f609686ab69d37469a6991a7d2aea6a 100644 (file)
@@ -313,8 +313,8 @@ setup_reload_pipe (DBusLoop *loop)
 
   dbus_error_init (&error);
 
-  if (!_dbus_full_duplex_pipe (&reload_pipe[0], &reload_pipe[1],
-                              TRUE, &error))
+  if (!_dbus_socketpair (&reload_pipe[0], &reload_pipe[1],
+                         TRUE, &error))
     {
       _dbus_warn ("Unable to create reload pipe: %s\n",
                  error.message);
index 8f5ff5fba692104b7669011a57df75bb64125987..32d62dd831eace4ac8c212ccc30e30d2c838269d 100644 (file)
@@ -246,8 +246,7 @@ _dbus_transport_debug_pipe_new (const char     *server_name,
       return NULL;
     }
   
-  if (!_dbus_full_duplex_pipe (&client_fd, &server_fd, FALSE,
-                               NULL))
+  if (!_dbus_socketpair (&client_fd, &server_fd, FALSE, NULL))
     {
       _dbus_verbose ("failed to create full duplex pipe\n");
       dbus_set_error (error, DBUS_ERROR_FAILED, "Could not create full-duplex pipe");
index 7da7a431bf3e1158ee9ba27b4a67d5c48a861337..f7b56d19e3f8bbe71da4f3d04fccd6e99ac8daad 100644 (file)
@@ -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,
index 959c1844b4d78eec8e0634a4c370b6067708c27b..86161e9cbea8b9ccfdd5d681373f10f347e7c8cf 100644 (file)
@@ -1258,7 +1258,7 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter          **sitter_p,
   if (!make_pipe (child_err_report_pipe, error))
     goto cleanup_and_fail;
 
-  if (!_dbus_full_duplex_pipe (&babysitter_pipe[0], &babysitter_pipe[1], TRUE, error))
+  if (!_dbus_socketpair (&babysitter_pipe[0], &babysitter_pipe[1], TRUE, error))
     goto cleanup_and_fail;
 
   /* Setting up the babysitter is only useful in the parent,
index 3f606712db76eefe07d9b3d0737a472b034f1adc..ab7efc25bb61e1b0d37b96e317319e28be566556 100644 (file)
@@ -3275,22 +3275,22 @@ _dbus_print_backtrace (void)
 }
 
 /**
- * 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)
 {
 #ifdef HAVE_SOCKETPAIR
   int fds[2];
@@ -3346,9 +3346,9 @@ _dbus_full_duplex_pipe (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
 }
index 50258151ae0ae6ec97c88a7cc22162082e9034e4..6e59c5eeff4dae11145d705baf197e90210b95af 100644 (file)
@@ -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;
index 2dbc420dca4d193c176d8110020d0d4bd492df70..bbbf708214875c709d76616128950d3dbfea0310 100644 (file)
@@ -438,10 +438,10 @@ dbus_bool_t _dbus_stat             (const DBusString *filename,
                                     DBusStat         *statbuf,
                                     DBusError        *error);
 DBUS_PRIVATE_EXPORT
-dbus_bool_t _dbus_full_duplex_pipe (int              *fd1,
-                                    int              *fd2,
-                                    dbus_bool_t       blocking,
-                                    DBusError        *error);
+dbus_bool_t _dbus_socketpair (int              *fd1,
+                              int              *fd2,
+                              dbus_bool_t       blocking,
+                              DBusError        *error);
 
 void        _dbus_print_backtrace  (void);