From 286ff380575699e743f4b595fb020cb37b7d5e8c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Thu, 22 Jan 2015 12:21:26 -0500 Subject: add threads option Signed-off-by: Andrew Gregory --- src/pacman/conf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/pacman/conf.c') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index a283d7f4..59c38696 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -606,6 +606,26 @@ static int _parse_options(const char *key, char *value, return 1; } FREELIST(values); + } else if(strcmp(key, "Threads") == 0) { + unsigned long threads; + char *endptr; + + if(!(alpm_capabilities() & ALPM_CAPABILITY_THREADS)) { + pm_printf(ALPM_LOG_ERROR, + _("config file %s, line %d: '%s' option invalid, no thread support\n"), + file, linenum, "Threads"); + return 1; + } + + threads = strtoul(value, &endptr, 10); + if(*endptr != '\0' || threads < 0) { + pm_printf(ALPM_LOG_ERROR, + _("config file %s, line %d: invalid value for '%s' : '%s'\n"), + file, linenum, "Threads", value); + return 1; + } + config->threads = threads; + pm_printf(ALPM_LOG_DEBUG, "config: Threads = %f\n", threads); } else { pm_printf(ALPM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), -- cgit v1.2.3-24-g4f1b