git » libjio » commit f95b0dc

jtrans_add(): Fix error return value for 0 length operations

author Alberto Bertogli
2009-07-12 18:07:45 UTC
committer Alberto Bertogli
2009-07-12 18:07:45 UTC
parent cacd80358a292c020978a2a2f49a1be69252ebcc

jtrans_add(): Fix error return value for 0 length operations

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/trans.c +1 -1

diff --git a/libjio/trans.c b/libjio/trans.c
index e738eb5..6a49c0d 100644
--- a/libjio/trans.c
+++ b/libjio/trans.c
@@ -119,7 +119,7 @@ int jtrans_add(struct jtrans *ts, const void *buf, size_t count, off_t offset)
 	/* fail for 0 length operations */
 	if (count == 0) {
 		pthread_mutex_unlock(&(ts->lock));
-		return 1;
+		return -1;
 	}
 
 	if ((long long) ts->len + count > MAX_TSIZE) {