aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-05-17 10:36:47 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-24 15:18:23 -0500
commit019e78ba6ec6f402dffc6bc9683f461a11a52c28 (patch)
treea94af7efd41021bd43b7c581fcaedca1e19ad51c /vl.c
parentebbeb789351a69d58b0da526fcb77bc82d18da7b (diff)
Fix error handling in qemu_read_config_file
We need to close the file even in error case. While at it, make the callers catch all kind of errors. ENOENT is allowed for default config files, they are optional. Reported-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 8c818f0d24..328395e3dd 100644
--- a/vl.c
+++ b/vl.c
@@ -2662,12 +2662,12 @@ int main(int argc, char **argv, char **envp)
int ret;
ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
- if (ret == -EINVAL) {
+ if (ret < 0 && ret != -ENOENT) {
exit(1);
}
ret = qemu_read_config_file(arch_config_name);
- if (ret == -EINVAL) {
+ if (ret < 0 && ret != -ENOENT) {
exit(1);
}
}