[sheepdog] [PATCH] journal file: fix wrong errno check

Liu Yuan namei.unix at gmail.com
Mon Nov 19 03:47:39 CET 2012


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

use ENOENT to represent 'no file found' case

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

diff --git a/sheep/journal_file.c b/sheep/journal_file.c
index 74a8d0b..9ed0686 100644
--- a/sheep/journal_file.c
+++ b/sheep/journal_file.c
@@ -83,7 +83,7 @@ static int get_old_new_jfile(const char *p, int *old, int *new)
 	sprintf(path, "%s/%s", p, jfile_name[0]);
 	fd1 = open(path, flags);
 	if (fd1 < 0) {
-		if (errno != EEXIST)
+		if (errno == ENOENT)
 			return 0;
 
 		eprintf("open1 %m\n");
-- 
1.7.9.5




More information about the sheepdog mailing list