From a49a960b5fad35dd525b06a8e8c3a71dc13d4df9 Mon Sep 17 00:00:00 2001 From: Gleydson Soares Date: Wed, 8 May 2013 00:15:04 +0000 Subject: tweak hvmd_init_guest() to check if everything was OK in md_read(), otherwise print out an error string and exit. OK jasper@ kettenis@ --- usr.sbin/ldomctl/config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ldomctl/config.c') diff --git a/usr.sbin/ldomctl/config.c b/usr.sbin/ldomctl/config.c index 7cef14167d7..5d538bdfe57 100644 --- a/usr.sbin/ldomctl/config.c +++ b/usr.sbin/ldomctl/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.18 2013/04/03 15:38:48 kettenis Exp $ */ +/* $OpenBSD: config.c,v 1.19 2013/05/08 00:15:03 gsoares Exp $ */ /* * Copyright (c) 2012 Mark Kettenis @@ -717,6 +717,10 @@ hvmd_init_guest(struct md *md, struct md_node *node) xasprintf(&path, "%s.md", guest->name); guest->md = md_read(path); + + if (guest->md == NULL) + err(1, "unable to get guest MD"); + free(path); } -- cgit v1.2.3