From f17fac86494d321cb281fcedaead16825ec9f78c Mon Sep 17 00:00:00 2001
From: dfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 4 Dec 2006 21:35:19 +0000
Subject: [PATCH] 	PR libgomp/29949 	* env.c (omp_set_num_threads):
 Set illegal thread count to 1.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119511 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog | 5 +++++
 libgomp/env.c     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index e704b2356f11..92b5600239aa 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-04  Daniel Franke  <franke.daniel@gmail.com>
+
+	PR libgomp/29949
+	* env.c (omp_set_num_threads): Set illegal thread count to 1.
+
 2006-12-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
 	* configure: Regenerate.
diff --git a/libgomp/env.c b/libgomp/env.c
index af7e0c5c813e..f07b31b914b3 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -225,7 +225,7 @@ initialize_env (void)
 void
 omp_set_num_threads (int n)
 {
-  gomp_nthreads_var = n;
+  gomp_nthreads_var = (n > 0 ? n : 1);
 }
 
 void
-- 
GitLab