[sheepdog] [PATCH] dog/farm/snap: fix incorrect conditional statement

Ruoyu liangry at ucweb.com
Mon Apr 21 10:37:21 CEST 2014


Both sides of != is the same.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 dog/farm/snap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dog/farm/snap.c b/dog/farm/snap.c
index df98a78..ff03047 100644
--- a/dog/farm/snap.c
+++ b/dog/farm/snap.c
@@ -151,7 +151,7 @@ void *snap_log_read(int *out_nr)
 	len = st.st_size - sizeof(hdr);
 	buffer = xmalloc(len);
 	ret = xpread(fd, buffer, len, sizeof(hdr));
-	if (len != len) {
+	if (ret != len) {
 		free(buffer);
 		buffer = (void *)-1;
 		goto out_close;
-- 
1.8.3.2





More information about the sheepdog mailing list