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:
parent
9726352d7a
commit
c6adc4ba8e
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* sched/pthread/pthread_initialize.c
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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 */
|
/* Try to take the semaphore */
|
||||||
|
|
||||||
int status = nxsem_trywait(sem);
|
int status = nxsem_trywait(sem);
|
||||||
ret = ret < 0 ? -ret : OK;
|
ret = status < 0 ? -status : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -168,7 +169,6 @@ int pthread_sem_give(sem_t *sem)
|
|||||||
|
|
||||||
/* Verify input parameters */
|
/* Verify input parameters */
|
||||||
|
|
||||||
|
|
||||||
DEBUGASSERT(sem != NULL);
|
DEBUGASSERT(sem != NULL);
|
||||||
if (sem != NULL)
|
if (sem != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user