summaryrefslogtreecommitdiffstats
path: root/src/pacman/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r--src/pacman/conf.c20
1 files changed, 20 insertions, 0 deletions
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"),