}
static dbus_bool_t
-server_watch_callback (DBusWatch *watch,
- unsigned int condition,
- void *data)
-{
- /* FIXME this can be done in dbus-mainloop.c
- * if the code in activation.c for the babysitter
- * watch handler is fixed.
- */
-
- return dbus_watch_handle (watch, condition);
-}
-
-static dbus_bool_t
add_server_watch (DBusWatch *watch,
void *data)
{
context = server_get_context (server);
- return _dbus_loop_add_watch (context->loop,
- watch, server_watch_callback, server,
- NULL);
+ return _dbus_loop_add_watch (context->loop, watch);
}
static void
context = server_get_context (server);
- _dbus_loop_remove_watch (context->loop,
- watch, server_watch_callback, server);
+ _dbus_loop_remove_watch (context->loop, watch);
}
-
static void
-server_timeout_callback (DBusTimeout *timeout,
- void *data)
+toggle_server_watch (DBusWatch *watch,
+ void *data)
{
- /* can return FALSE on OOM but we just let it fire again later */
- dbus_timeout_handle (timeout);
+ DBusServer *server = data;
+ BusContext *context;
+
+ context = server_get_context (server);
+
+ _dbus_loop_toggle_watch (context->loop, watch);
}
static dbus_bool_t
context = server_get_context (server);
- return _dbus_loop_add_timeout (context->loop,
- timeout, server_timeout_callback, server, NULL);
+ return _dbus_loop_add_timeout (context->loop, timeout);
}
static void
context = server_get_context (server);
- _dbus_loop_remove_timeout (context->loop,
- timeout, server_timeout_callback, server);
+ _dbus_loop_remove_timeout (context->loop, timeout);
}
static void
if (!dbus_server_set_watch_functions (server,
add_server_watch,
remove_server_watch,
- NULL,
+ toggle_server_watch,
server,
NULL))
{
BusConfigParser *parser,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
DBusString log_prefix;
retval = FALSE;
auth_mechanisms = NULL;
+ pidfile = NULL;
_dbus_init_system_log ();
* avoid that. But we want to check for the pid file
* before overwriting any existing sockets, etc.
*/
- pidfile = bus_config_parser_get_pidfile (parser);
+
+ if (write_pidfile)
+ pidfile = bus_config_parser_get_pidfile (parser);
+
if (pidfile != NULL)
{
DBusString u;
if (auth_mechanisms[i] == NULL)
goto oom;
link = _dbus_list_get_next_link (auth_mechanisms_list, link);
+ i += 1;
}
}
else
DBusString full_address;
DBusList *link;
DBusList **dirs;
- BusActivation *new_activation;
char *addr;
const char *servicehelper;
char *s;
DBusPipe *print_pid_pipe,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
- DBusString log_prefix;
BusContext *context;
BusConfigParser *parser;
goto failed;
}
- if (!process_config_first_time_only (context, parser, address, systemd_activation, error))
+ if (!process_config_first_time_only (context, parser, address, systemd_activation, write_pidfile, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
goto failed;
dbus_bool_t log;
int type;
dbus_bool_t requested_reply;
- const char *sender_name;
- const char *sender_loginfo;
- const char *proposed_recipient_loginfo;
type = dbus_message_get_type (message);
dest = dbus_message_get_destination (message);
proposed_recipient,
message, &toggles, &log))
{
- const char *msg = "Rejected send message, %d matched rules; "
- "type=\"%s\", sender=\"%s\" (%s) interface=\"%s\" member=\"%s\" error name=\"%s\" requested_reply=%d destination=\"%s\" (%s))";
-
complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
"Rejected send message", toggles,
message, sender, proposed_recipient, requested_reply,