mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-18 19:35:53 +00:00
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:
+3
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user