summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd9a22a)
raw | patch | inline | side by side (parent: dd9a22a)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 20 Oct 2013 20:20:36 +0000 (22:20 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 20 Oct 2013 20:20:36 +0000 (22:20 +0200) |
src/utils/channel.c | patch | blob | history |
diff --git a/src/utils/channel.c b/src/utils/channel.c
index 6db9b9512310b8d626ea12f73e33e90a5ff3d34e..af41b477b4748252763123b8a0303aa5edc06676 100644 (file)
--- a/src/utils/channel.c
+++ b/src/utils/channel.c
if (timeout) {
struct timespec abstime;
- if (clock_gettime(CLOCK_REALTIME, &abstime))
+ if (clock_gettime(CLOCK_REALTIME, &abstime)) {
+ pthread_mutex_unlock(&chan->lock);
return -1;
+ }
abstime.tv_sec += timeout->tv_sec;
abstime.tv_nsec += timeout->tv_nsec;
else
status = pthread_cond_wait(&chan->cond, &chan->lock);
}
-
pthread_mutex_unlock(&chan->lock);
+
if (status) {
errno = status;
return -1;