From c8991b0f95a3b53bc98de9e029780bbe0a0b3114 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 6 Apr 2003 20:04:47 +0000 Subject: 2003-04-06 Havoc Pennington * bus/bus.c (bus_context_new): print the address in here, rather than in main(), because we need to do it before forking the daemon * bus/dispatch.c (send_service_nonexistent_error): set the sender on the service nonexistent error * bus/driver.c (bus_driver_handle_acquire_service): set the sender on the AcquireService reply * test/data/valid-config-files/debug-allow-all.conf.in: Make test server also listen on a UNIX socket so services can connect to it. --- bus/main.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'bus/main.c') diff --git a/bus/main.c b/bus/main.c index 119520ff..d18d61ac 100644 --- a/bus/main.c +++ b/bus/main.c @@ -216,7 +216,7 @@ main (int argc, char **argv) } dbus_error_init (&error); - context = bus_context_new (&config_file, &error); + context = bus_context_new (&config_file, print_addr_fd, &error); _dbus_string_free (&config_file); if (context == NULL) { @@ -225,37 +225,6 @@ main (int argc, char **argv) dbus_error_free (&error); exit (1); } - - /* Note that we don't know whether the print_addr_fd is - * one of the sockets we're using to listen on, or some - * other random thing. But I think the answer is "don't do - * that then" - */ - if (print_addr_fd >= 0) - { - DBusString addr; - const char *a = bus_context_get_address (context); - int bytes; - - _dbus_assert (a != NULL); - if (!_dbus_string_init (&addr) || - !_dbus_string_append (&addr, a) || - !_dbus_string_append (&addr, "\n")) - exit (1); - - bytes = _dbus_string_get_length (&addr); - if (_dbus_write (print_addr_fd, &addr, 0, bytes) != bytes) - { - _dbus_warn ("Failed to print message bus address: %s\n", - _dbus_strerror (errno)); - exit (1); - } - - if (print_addr_fd > 2) - _dbus_close (print_addr_fd, NULL); - - _dbus_string_free (&addr); - } /* FIXME we have to handle this properly below _dbus_set_signal_handler (SIGHUP, signal_handler); */ _dbus_set_signal_handler (SIGTERM, signal_handler); -- cgit