[at-spi2-core: 13/32] Future-proof the count of source_fds / target_fds




commit d4fa3aaed31f515bd1986c8795c1ff52af26f202
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Dec 13 17:30:58 2021 +0000

    Future-proof the count of source_fds / target_fds
    
    Thanks to Philip Withnall for the suggestions.

 bus/at-spi-bus-launcher.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 23a258d5..77d71647 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -353,6 +353,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
   char *argv[] = { DBUS_DAEMON, config_path, "--nofork", "--print-address", print_address_fd_param, 
address_param, NULL };
   gint source_fds[1] = { app->pipefd[1] };
   gint target_fds[1] = { app->pipefd[1] };
+  G_STATIC_ASSERT (G_N_ELEMENTS (source_fds) == G_N_ELEMENTS (target_fds));
   GPid pid;
   char addr_buf[2048];
   GError *error = NULL;
@@ -371,7 +372,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
                                          -1, /* stdout_fd */
                                          source_fds,
                                          target_fds,
-                                         1, /* n_fds in source_fds and target_fds */
+                                         G_N_ELEMENTS (source_fds), /* n_fds in source_fds and target_fds */
                                          &pid,
                                          NULL, /* stdin_pipe_out */
                                          NULL, /* stdout_pipe_out */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]