summaryrefslogtreecommitdiff
path: root/bus/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/bus/bus.c b/bus/bus.c
index e8276af4..66633470 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -372,11 +372,20 @@ process_config_first_time_only (BusContext *context,
if (!credentials)
goto oom;
if (!_dbus_string_append (&log_prefix, "[session "))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
if (!_dbus_credentials_to_string_append (credentials, &log_prefix))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
if (!_dbus_string_append (&log_prefix, "] "))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
_dbus_credentials_unref (credentials);
}
if (!_dbus_string_steal_data (&log_prefix, &context->log_prefix))
@@ -618,7 +627,6 @@ list_concat_new (DBusList **a,
*result = NULL;
- link = _dbus_list_get_first_link (a);
for (link = _dbus_list_get_first_link (a); link; link = _dbus_list_get_next_link (a, link))
{
if (!_dbus_list_append (result, link->data))
@@ -636,6 +644,24 @@ oom:
return FALSE;
}
+static void
+raise_file_descriptor_limit (BusContext *context)
+{
+
+ /* I just picked this out of thin air; we need some extra
+ * descriptors for things like any internal pipes we create,
+ * inotify, connections to SELinux, etc.
+ */
+ unsigned int arbitrary_extra_fds = 32;
+ unsigned int limit;
+
+ limit = context->limits.max_completed_connections +
+ context->limits.max_incomplete_connections
+ + arbitrary_extra_fds;
+
+ _dbus_request_file_descriptor_limit (limit);
+}
+
static dbus_bool_t
process_config_postinit (BusContext *context,
BusConfigParser *parser,
@@ -644,6 +670,8 @@ process_config_postinit (BusContext *context,
DBusHashTable *service_context_table;
DBusList *watched_dirs = NULL;
+ raise_file_descriptor_limit (context);
+
service_context_table = bus_config_parser_steal_service_context_table (parser);
if (!bus_registry_set_service_context_table (context->registry,
service_context_table))