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:
Paul Sokolovsky 2017-04-06 22:51:02 +03:00 committed by Anas Nashif
commit 4a928409e8

View file

@ -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);
}