Browse Source

disallow cpu time clocks as condattr clock values

Rich Felker 14 years ago
parent
commit
9d5251f72b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/thread/pthread_condattr_setclock.c

+ 1 - 1
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;