pthread_condattr_setclock(3): Fix the check for a known clock.
authorSascha Wildner <saw@online.de>
Mon, 5 Dec 2011 21:46:06 +0000 (22:46 +0100)
committerSascha Wildner <saw@online.de>
Mon, 5 Dec 2011 21:46:06 +0000 (22:46 +0100)
The way it was before, this function would always return EINVAL.

lib/libthread_xu/thread/thr_condattr.c

index 9705243..30f41b1 100644 (file)
@@ -28,8 +28,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $DragonFly: src/lib/libthread_xu/thread/thr_condattr.c,v 1.6 2006/04/06 13:03:09 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -96,7 +94,7 @@ _pthread_condattr_setclock(pthread_condattr_t *attr,
 {
        if (attr == NULL || *attr == NULL)
                return (EINVAL);
-       if (clock_id != CLOCK_REALTIME ||
+       if (clock_id != CLOCK_REALTIME &&
            clock_id != CLOCK_MONOTONIC)
                return (EINVAL);
        (*attr)->c_clockid = clock_id;