about summary refs log tree commit diff
path: root/src/thread
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-08 02:32:42 -0500
committerRich Felker <dalias@aerifal.cx>2011-03-08 02:32:42 -0500
commit9d5251f72b627974bcf438501e07ad42c24d94be (patch)
tree26193efde73fed23c8bb0624d7b2e842e2dc50c8 /src/thread
parent5d0d6d983664cc3816d63432397271719dade83c (diff)
downloadmusl-9d5251f72b627974bcf438501e07ad42c24d94be.tar.gz
musl-9d5251f72b627974bcf438501e07ad42c24d94be.tar.xz
musl-9d5251f72b627974bcf438501e07ad42c24d94be.zip
disallow cpu time clocks as condattr clock values
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/pthread_condattr_setclock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_condattr_setclock.c b/src/thread/pthread_condattr_setclock.c
index bf745523..cd2cecc9 100644
--- a/src/thread/pthread_condattr_setclock.c
+++ b/src/thread/pthread_condattr_setclock.c
@@ -2,7 +2,7 @@
 
 int pthread_condattr_setclock(pthread_condattr_t *a, clockid_t clk)
 {
-	if (clk < 0) return EINVAL;
+	if (clk < 0 || clk-2U < 2) return EINVAL;
 	*a &= 0x80000000;
 	*a |= clk;
 	return 0;