voron

experimental ARM OS
git clone git://git.2f30.org/voron
Log | Files | Refs | README | LICENSE

commit 7f6eda4aad62feb19ed3a299250ba3f4492ae9f4
parent b34af5b689d30ab5fdc019310a5203cf444eb1c7
Author: oblique <psyberbits@gmail.com>
Date:   Wed, 24 Jul 2013 03:54:28 +0300

kfifo.c: use errno.h return codes

Diffstat:
Mkernel/kfifo.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/kfifo.c b/kernel/kfifo.c @@ -57,7 +57,7 @@ enqueue_kfifo(struct kfifo *kfifo, void *buf, size_t siz) tmp = krealloc(kfifo->buf, kfifo->cap + siz); if (!tmp) { spinlock_unlock(&kfifo->lock); - return -1; + return -ENOMEM; } kfifo->buf = tmp; memcpy(kfifo->buf + kfifo->siz, buf, siz); @@ -76,7 +76,7 @@ dequeue_kfifo(struct kfifo *kfifo, void *buf, size_t siz) spinlock_lock(&kfifo->lock); if (kfifo->siz < siz) { spinlock_unlock(&kfifo->lock); - return -1; + return -EINVAL; } memcpy(buf, kfifo->buf, siz); memmove(kfifo->buf, kfifo->buf + siz, kfifo->siz - siz);