[sheepdog] [PATCH stable-0.7] dog: fix return value of vdi_backup()

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Tue Oct 29 09:28:25 CET 2013


From: Ryusuke Konishi <konishi.ryusuke at lab.ntt.co.jp>

"dog vdi backup" command returns 16 as its status code even if it
successfully ended.

This is because the current vdi_backup function returns the byte count
returned by the last xwrite call in the function.

This fixes the issue by overwriting the return code with EXIT_SUCCESS
at the end of the normal path of vdi_backup().

Signed-off-by: Ryusuke Konishi <konishi.ryusuke at lab.ntt.co.jp>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 dog/vdi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/dog/vdi.c b/dog/vdi.c
index b650496..5cbc85a 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -1745,6 +1745,7 @@ static int vdi_backup(int argc, char **argv)
 	}
 
 	fsync(STDOUT_FILENO);
+	ret = EXIT_SUCCESS;
 out:
 	free(from_inode);
 	free(to_inode);
-- 
1.7.10.4




More information about the sheepdog mailing list