[sheepdog] [PATCH] plain: fix prealloc() errno

Liu Yuan namei.unix at gmail.com
Mon Sep 17 13:06:19 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

This will fix the spurious failure of tests/042.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/plain_store.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 5a12278..0002f7e 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -307,7 +307,7 @@ int prealloc(int fd, uint32_t size)
 	if (ret < 0) {
 		if (errno != ENOSYS && errno != EOPNOTSUPP) {
 			dprintf("%m\n");
-			ret = SD_RES_SYSTEM_ERROR;
+			ret = err_to_sderr(0, errno); /* FIXME: set oid */
 		} else
 			ret = write_last_sector(fd, size);
 	} else
-- 
1.7.10.2




More information about the sheepdog mailing list