summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 8ab2005c2f..249c683c92 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -290,6 +290,12 @@ static int grep_cmd_config(const char *var, const char *value, void *cb)
if (num_threads < 0)
die(_("invalid number of threads specified (%d) for %s"),
num_threads, var);
+#ifdef NO_PTHREADS
+ else if (num_threads && num_threads != 1) {
+ warning(_("no threads support, ignoring %s"), var);
+ num_threads = 0;
+ }
+#endif
}
return st;
@@ -1222,6 +1228,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
if (num_threads == 1)
num_threads = 0;
#else
+ if (num_threads)
+ warning(_("no threads support, ignoring --threads"));
num_threads = 0;
#endif