diff --git a/sched/pthread/pthread_initialize.c b/sched/pthread/pthread_initialize.c index ccdab7a8d9..95cf18700a 100644 --- a/sched/pthread/pthread_initialize.c +++ b/sched/pthread/pthread_initialize.c @@ -1,7 +1,8 @@ /**************************************************************************** * sched/pthread/pthread_initialize.c * - * Copyright (C) 2007-2010, 2013, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2013, 2017-2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -155,7 +156,7 @@ int pthread_sem_trytake(sem_t *sem) /* Try to take the semaphore */ int status = nxsem_trywait(sem); - ret = ret < 0 ? -ret : OK; + ret = status < 0 ? -status : OK; } return ret; @@ -168,7 +169,6 @@ int pthread_sem_give(sem_t *sem) /* Verify input parameters */ - DEBUGASSERT(sem != NULL); if (sem != NULL) {