diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-06 20:04:47 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-06 20:04:47 +0000 |
commit | c8991b0f95a3b53bc98de9e029780bbe0a0b3114 (patch) | |
tree | a34064ca3cac6aba415b29079035866982cdbe0a /bus/main.c | |
parent | bc8b061eec0fd9de6552a9e6118c40283863b6dc (diff) |
2003-04-06 Havoc Pennington <hp@pobox.com>
* 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.
Diffstat (limited to 'bus/main.c')
-rw-r--r-- | bus/main.c | 33 |
1 files changed, 1 insertions, 32 deletions
@@ -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); |