subsys/logging: sys_event_logger_get: Fix k_sem_take() success check.
k_sem_take() is documented as returning negative value for error and 0 for success. The old code didn't work. Change-Id: I717b35d73fced476b50e3207410858f86c2ef9bc Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
a90ae56504
commit
4a928409e8
1 changed files with 1 additions and 1 deletions
|
@ -106,7 +106,7 @@ int sys_event_logger_get(struct event_logger *logger, uint16_t *event_id,
|
|||
uint8_t *dropped_event_count, uint32_t *buffer,
|
||||
uint8_t *buffer_size)
|
||||
{
|
||||
if (k_sem_take(&(logger->sync_sema), K_NO_WAIT)) {
|
||||
if (k_sem_take(&(logger->sync_sema), K_NO_WAIT) == 0) {
|
||||
return event_logger_get(logger, event_id, dropped_event_count,
|
||||
buffer, buffer_size);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue