kvm tools: close opened file

The file should be closed before return.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Cong Ding
2013-01-16 17:51:44 +01:00
committed by Will Deacon
parent 9eb3dbcbc8
commit 63fd57b95c
+3 -3
View File
@@ -159,12 +159,12 @@ static int copy_passwd(const char *guestfs_name)
return -1;
ret = fprintf(file, "root:x:0:0:root:/root:/bin/sh\n");
if (ret < 0)
return ret;
if (ret > 0)
ret = 0;
fclose(file);
return 0;
return ret;
}
static int make_guestfs_symlink(const char *guestfs_name, const char *path)