X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bus%2Fbus.c;h=6663347030a005abc4736e1c66ce9ba936e57a76;hb=66a09fa7c3c8e4232b4225c49d01d9efb97458c9;hp=e8276af454cb0333f77bd77339b633cd1ad6e17e;hpb=401503681370c68c194a849f76f58b3a0b529bb0;p=platform%2Fupstream%2Fdbus.git diff --git a/bus/bus.c b/bus/bus.c index e8276af..6663347 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))