1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

If threads is set to 0, try to autodetect number of threads.

This commit is contained in:
Dave Davenport 2015-11-12 17:20:51 +01:00
parent e6ca8acba9
commit 45c8de9387
3 changed files with 16 additions and 8 deletions

View file

@ -38,6 +38,7 @@ AS_IF([test "x$enable_i3support" != xno && test "x$enable_windowmode" != "xno"],
##
AC_CHECK_FUNC([getdelim],, AC_MSG_ERROR("Could not find getdelim in c library"))
AC_CHECK_FUNC([sysconf],, AC_MSG_ERROR("Could not find sysconf"))
##
# Check dependencies
##

View file

@ -513,6 +513,13 @@ void remove_pid_file ( int fd )
*/
void config_sanity_check ( Display *display )
{
if ( config.threads == 0 ) {
config.threads = 1;
long procs = sysconf ( _SC_NPROCESSORS_CONF );
if ( procs > 0 ) {
config.threads = MIN(procs,UINT_MAX);
}
}
// If alternative row is not set, copy the normal background color.
// Do this at the beginning as we might use it in the error dialog.
if ( config.menu_bg_alt == NULL ) {