semaphore: do not overwrite errno in sem_timedwait()
authorEunBong Song <eunb.song@samsung.com>
Wed, 19 Apr 2017 00:57:53 +0000 (09:57 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Sat, 6 May 2017 10:50:07 +0000 (19:50 +0900)
commit37424087523d40930e9f3b98e8c229e944497c0c
tree8b529c3a122c771f0bcb55bdda77594716a8b30f
parent11705923c6d7f3c960e0079cfe02b5ac19d2cfa4
semaphore: do not overwrite errno in sem_timedwait()

This patch fixes problem that the errno value was being overwritten by
subsequent actions so that the returned errno value was incorrect.
All credits should go to Gregory Nutt who wrote the original commit.

Change-Id: I6ed3177e471f3ecb7aa79ada88c64b3db867ec28
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
[Song: backported 127951e0 from NuttX]
Signed-off-by: EunBong Song <eunb.song@samsung.com>
os/kernel/semaphore/sem_timedwait.c