sched/pthread/pthread_initialize.c: Fix a warning found in build testing (that is actually and bug and would cause an incorrect value to be returned in many cases.

This commit is contained in:
Gregory Nutt 2018-08-05 16:23:07 -06:00
parent 9726352d7a
commit c6adc4ba8e
1 changed files with 3 additions and 3 deletions

View File

@ -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 <gnutt@nuttx.org>
*
* 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)
{