[sheepdog] [PATCH] sheep: fix a bad return value check in jrnl_recover

levin li levin108 at gmail.com
Thu Jul 5 09:37:26 CEST 2012


From: levin li <xingke.lwp at taobao.com>


Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/journal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/journal.c b/sheep/journal.c
index 646879c..e6946e9 100644
--- a/sheep/journal.c
+++ b/sheep/journal.c
@@ -275,7 +275,7 @@ int jrnl_recover(const char *jrnl_dir)
 			goto end_while_2;
 
 		jd.target_fd = open(jd.head.target_path, O_DSYNC | O_RDWR);
-		if (ret) {
+		if (jd.target_fd < 0) {
 			eprintf("unable to open the object file %s for recovery\n",
 				jd.head.target_path);
 			goto end_while_2;
-- 
1.7.1




More information about the sheepdog mailing list